date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,687,753,520,000 |
I am trying to install FreeRadius 3.0.16 in Debian 9 from my local repository.
However when trying to install it I got this error:
The following packages have unmet dependencies:
freeradius : Depends: libssl1.0.0 (>= 1.0.1e-2+deb7u5) but it is not installable
The culprit is in the original source code at freeradius-... |
I would just remove those lines of code; it’s not up to individual packages to force security upgrades in other packages.
If you look at the Debian package’s rules, you’ll see it doesn’t have anything like this. In any case, as you point out the dependencies can’t work on Debian 9 since that uses a different package n... | Defining multiple library dependencies |
1,687,753,520,000 |
What is the most easy/intuitive way to get code for some Python package that is distributed with Debian if I am not on Debian (no apt-get here)?
For example, there was a bug with pip on Debian and I want to see if it is fixed by comparing its code with upstream.
|
I would go to https://packages.debian.org/source/<release>/<package> where <release> is the particular release of Debian I was interested in, and <package> is the package name.
For example: https://packages.debian.org/source/stable/python-pip
From there, I would scroll down to the bottom of the page and download the ... | Get the Debian version of the sources of a Python package |
1,687,753,520,000 |
I am trying to package an Ubuntu package as a Debian package. For maintainability I am trying to use sbuild.
Following the steps here
I go through the first five steps, but when I try to build I get chroot errors.
These are the steps:
1 sudo apt-get install sbuild
2 sudo mkdir /root/.gnupg # To work around #7921... |
You are expected to rename the /etc/schroot/chroot.d/jessie-amd64-sbuild-k92zq_ file created by sbuild-createchroot to jessie-amd64-sbuild (that is, just drop the random suffix). You may also edit it if you wish. They you should be able to schroot -c jessie-amd64-sbuild and sbuild -d jessie whatever.dsc. You use tarba... | sbuild schroot fails |
1,687,753,520,000 |
I used dh_make to create a basic Debian package install. I added a dependency which is the actual program I want. All I want to do is overwrite the conf file this package installed, with a new file with bunch of custom parameters.
I tried to use the install file which looks like this:
file.conf /etc/destination/file.c... |
I ended up solving this problem by using a package called config-package-dev.
config-package-dev link
While I didn't realize it at the time, there was a big flaw in what I was trying to do previously. Updates or changes to the package could have overwritten my custom .conf files on update and the system would have be... | Use a package to install dependency and copy custom conf file |
1,687,753,520,000 |
I've download the .tar.gz, .dsc and .diff.gz of the bash package from Wheezy: https://packages.debian.org/wheezy/bash. Then I ran dpkg-source -x on the dsc file to unpack it, and this is the result:
$ ls -l
total 2696
-rw-rw-r-- 1 pgimeno pgimeno 2748840 Dec 30 2012 bash-4.2dfsg.tar.xz
drwxrwxr-x 3 pgimeno pgimeno ... |
The central place that records what to do with a source package is debian/rules. It's a makefile, and a few targets are mandatory or standardized, including build, which will of necessity unpack and patch any source archive, and patch, which should unpack and patch any source archive. Many packages use helper scripts,... | Unpacking source Debian package that has a tar.xz |
1,687,753,520,000 |
Mono 3.0 has been released yesterday. I am really excited by this release and am curious to know when this will be available in Debian testing (Wheezy).
Is there a standard timeline set by Debian project for when the newest release of a software will be made available into Testing or in general any of the branches, ex... |
Currently, Debian testing is in a freeze state. This means that new uploads must be approved by the release team, and generally must fix RC (release critical) bugs. It is very rare for the release team to accept new upstream releases (rather than patches specifically for RC bugs) after the freeze.
So the answer to thi... | How soon do new releases get packaged into Debian Testing? |
1,687,753,520,000 |
In Linux, according to the Filesystem Hierarchy Standard, /opt is the designated location for add-on application software packages. Thus, when developing my own software package, which is not a dependency for anything else, I would place that in /opt/somepackage, with a hierarchy of my choice underneath.
FreeBSD, acco... |
You install user programs in /usr/local/. There is no /opt in the standard install or mentioned in the hier man page.
From the man page:
/usr/ contains the majority of user utilities and applications
And:
local/ local executables, libraries, etc. Also used
as the default destination for the ports(7)
frame... | Where to install custom software packages on FreeBSD? |
1,687,753,520,000 |
I have a package where I want the administrator to enter a list of interface names. I'd like that list to have a default. Only each system has a different list (eth0, enp0s3, eno1, to list a few).
Here is an example about just that:
Template: iplock/public_interfaces
Type: string
Default: eth0
Description: Public Inte... |
The value of a question can be set dynamically, but not using the template default:
Don't make the mistake of thinking that the default field contains the "value" of the question, or that it can be used to change the value of the question. It does not, and cannot, it just provides a default value for the first time t... | How do you define a dynamic default value in a Debian package template? |
1,687,753,520,000 |
I am trying to debianize a collection of shell scripts. The build itself is quite simple, as there are no binaries to build – every file that will be installed on the target system is already present in the source tree.
Now the build process fails with an error message I cannot make sense of:
dpkg-genbuildinfo: error:... |
As further research showed, the “files list file” is an auto-generated file named debian/files. As I suspected, there was no issue with the .install file.
Looking at debian/files, the first line read
autorecover_0.0.1_all.deb net # FIXME optional
This line should have the form
name_version_arch.deb section optional
... | dpkg-genbuildinfo: error: badly formed line in files list file, line 1 |
1,687,753,520,000 |
The documentation for creating RPM packages in Fedora Linux states that
There are potentially four fields which comprise the structured
Release: tag:
package release number (<pkgrel>)
extra version information (<extraver>)
snapshot information (<snapinfo>)
minor release bump (<minorbump>)
However, I can not f... |
The fields describe the structure of the release tag; how you construct it is largely up to you.
In your case, I’ll assume the upstream version is 1.2.3 beta, and this is the 4th packaging update (so your release would be 4, ignoring the beta part). The traditional approach would be to write
Version: 1.2.3
Release: 4.... | How are the pkgrel, extraver, snapinfo and minorbump fields of RPM's Release tag used? |
1,687,753,520,000 |
I see on some sites they mention a centos-7 template that ships with mock,
/etc/mock/centos-7-aarch64.cfg
/etc/mock/centos-7-armhfp.cfg
/etc/mock/centos-7-i386.cfg
/etc/mock/centos-7-ppc64.cfg
/etc/mock/centos-7-ppc64le.cfg
/etc/mock/centos-7-x86_64.cfg
However, on my install mock on centos-7 I lack these files? Whi... |
You seem to have installed a newer version of mock provided by EPEL.
For that package, the config files are changed from /etc/mock/centos-7-x86_64.cfg to /etc/mock/epel-7-x86_64.cfg and are provided by the RPM package mock-core-configs.
The newer mock seems to be for the transition to dnf and python3, so they may ha... | What is the mock template for centos-7? |
1,687,753,520,000 |
I have inherited a software project which builds a set of RPMs to be installed on a RHEL server. When I attempt to install the packages on a server, I get a "transaction check vs depsolve" error saying the package requires libc.so.6. I have found that the error will go away if I install glibc.i686.
The problem here i... |
I ended up extracting the RPM and using a one-liner to find the offending binaries:
find . -print0 | xargs -0 file | grep 'ELF 32'
This listed all of the 32-bit binaries in the directory.
| How can I see what is triggering a "transaction check vs depsolve" error? |
1,687,753,520,000 |
I am back-porting the Debian package for openldap to jessie and have run into some problems with our local Debian repository. Using git-buildpackage, the Debian package goes fine, but when I get to the dput step I get an error. We have a local Debian repository where I am uploading this package. The local Debian repos... |
You need to tell dpkg-genchanges to include the original source, using its -sa option. You can give the option to git-buildpackage and it will pass it on:
gbp buildpackage -sa
(or git-buildpackage -sa perhaps with the Jessie version).
You only need to do that the first time you upload a given upstream version to a re... | Missing tar file in changes file after Debian package build |
1,687,753,520,000 |
I am working on a debian package which usually installs in /tftpboot/linux/
This packages is also distributed on UCS (Univention Corporate Server), a debian based server system.
They need these files in another directory (/var/lib/univention-client-boot). How do I adapt the corresponding debian files to make it recogn... |
You could do this in a .postinst script - check to see if it is being installed on the UCS server and create the required directory structure (under /var/lib/var/lib/univention-client-boot) and symlnks.
Note that if you want to follow debian policy, the symlinks should be made relative (to the directory containing the... | Install deb Package files in another directory |
1,687,753,520,000 |
I'm trying to merge build configuration for different version of debian (as it's hard to maintain when separated).
There are only a few minor changes, but the main issue I run into is that I don't know how to detect the current version of debian inside of the "rules" file.
Do I just parse the /etc/debian_version file,... |
You should use /usr/bin/lsb_release for that.
lsb_release -rs is probably what you want.
| Detect debian version in "rules" package file |
1,687,753,520,000 |
I'm looking for a way of having my package searchable by other Debian users from the command line. I don't want to go through the process of having to get a sponsor. Is there some kind of community repo where I could self publish it to like Arch has?
|
No, there is not.
You could create you own repository, like many projects do. But that alone won't help your visibility.
| Is there an Arch community repository system for Debian? |
1,687,753,520,000 |
Is there a good reason why apt-get remove leaves installed cron files in place where an apt-get purge or apt-get remove --purge is actually required to completely remove them?
Example files may be:
/etc/cron.d/<packagename>, or
/etc/cron.hourly/<packagename>
The man pages and everything else I've seen seems to ind... |
Yes, those files are considered configuration files. Generally, (at least) everything in /etc is considered a configuration file in Debian. That's why it takes a purge to remove them. The reason they are configured configuration files is that anything that the system administrator is reasonably expected to customize o... | Why does apt-get remove leave package-installed cron files lying around? |
1,687,753,520,000 |
The guidelines for Fedora remixes suggest to replaces packages fedora-logos, fedora-release, and fedora-release-notes with the generic-* equivalents when making a remix. Most tutorials online focus on creating a live-cd remix; I'm interesting in creating a VM, without making a live CD first.
I tried the following:
yu... |
What about this?
# yum shell
> remove fedora-logos fedora-release fedora-release-notes
> install generic-logos generic-release generic-release-notes
> run
--> Running transaction check
---> Package fedora-logos.x86_64 0:21.0.5-1.fc21 will be erased
---> Package fedora-release.noarch 0:21-2 will be erased
--> Processin... | Installing generic-logos and generic-release on Fedora |
1,687,753,520,000 |
We're using HP DataProtector for our backup environment. The installation method leaves something to be desired, and we're attempting to automate it in such a way that it makes our Unix admins cringe less often. We're a SLES/OpenSUSE shop, so we're attempting to make up a YUM repository with the DP patches.
I can make... |
Rather than re-package the existing RPM, inspired by HP I packaged it in an additional RPM. The new RPM is very simple in that it just has the single patch-RPM inside it, and invokes the rpm command to install it.
| Repackaging RPMs |
1,687,753,520,000 |
I'm trying to understand how the creation of packages (rpm, deb, dpkg) work and what the architecture supports and doesn't.
Right now I struggle figuring out what happens when the installation or upgrade of a package fails at different points of the process -ie, error on a scriptlet, not enough disk space (is this che... |
For Debian (and typically, derivatives), this is described in the Debian Policy chapter on maintainer scripts and the corresponding flowcharts. Errors are handled in combination by dpkg (the tool which handles package extraction etc.) and maintainer scripts.
When upgrading a package:
the existing package’s pre-remova... | Package installation failure and rollback options |
1,687,753,520,000 |
When writing a .spec file for Fedora, I ran into a problem. I can't seem to be able to do fedpkg mockbuild at all. No matter what source I use, HTTPS or local, I keep running into this error:
Failed to get repository name from Git url or pushurl
Failed to get ns from Git url or pushurl
Could not execute mockbuild: ('C... |
You are using the character - in the version. According to the specification:
The version string consists of alphanumeric characters, which can optionally be segmented with the separators ., _ and +, plus ~ and ^ (see below).
Tilde (~) can be used to force sorting lower than base (1.1~201601 < 1.1). Caret (^) can be ... | Could not execute mockbuild: Could not download sources |
1,660,032,310,000 |
I'm aiming to translate a Debian package to an RPM package to install it on a CentOS Linux 7 (Red Hat).
I used alien to accomplish it: alien --to-rpm --scripts --keep-version --generate debian_pkg.deb. I use the --generate flag to create a directory for building a package from, because I want to add the runtime depend... |
UPDATE: The problem you're having is with the Buildroot: tag in the specfile.
In modern systems (and perhaps yours included), Buildroot: in a spec file is no longer supported and it's now ignored.
See this post on LinuxQuestions about that:
Fedora (as of F-10) does not require the presence of the BuildRoot tag in the... | CentOS 7 - problem encountered with the set up of spec file during creation of RPM package |
1,660,032,310,000 |
Here's a question and answers on what delta RPMs actually are: What is DRPM and How does it differ from RPM?
I'm interested in the algorithms and data structures server side. I've Googled but nothing useful shows up.
Do they (Red Hat) generate the requested delta on the fly, or are all possible deltas pregenerated and... |
Deltas are generated when repo is created/updated. Usually:
createrepo_c --update --deltas --num-deltas 1 .
For more information see man createrepo_c and man makedeltarpm
| How do delta RPMs work at the server end? |
1,660,032,310,000 |
I'd like to install libuv on a Ubuntu WSL instance, and I specifically need version 1.45.0 or later.
My understanding (from this tutorial article) is that the command to find out what versions of a package are available to install is apt list | grep:
$ apt list | grep libuv
WARNING: apt does not have a stable CLI int... |
Trunks and Trees
While @TechLoom answered your question regarding libuv, allow me to answer you question regarding the Linux ecosystem. Let's start with
Open that up in a new browser tab, and note that there are 5 major trunks:
Slackware
Debian
Red Hat, who went corporate, and the free variant is referred to as Fed... | How to install package versions not available with apt-get? |
1,660,032,310,000 |
Unison is a cross-platform file synchronisation software. The latest version available on Debian is outdated: Debian has version 2.40.102-2 while other systems have version 2.48.3.
The thing is, Unison will not work between two machines that use different version, so Unison 2.48 on Mac OS will not sync with a machine ... |
You don't need reputation in the Debian community to help out, just the willingness to help, and patience while you wait for the current maintainer to react. Given that Unison officially still has a maintainer in Debian, you should indicate your interest on the existing bug, and email the maintainer (both the OCaml ma... | Update Unison in the default Debian repositories |
1,660,032,310,000 |
Is there a service that guides how to wrap your software for all flavors of Linux, and provides a build farm that cross-compiles them?
|
The Open Build Service does just that: it allows you to build packages for all the main Linux distributions, on all the major architectures. You can build .deb, .rpm or .pkg packages, on RHEL, Fedora, CentOS, Debian, Ubuntu, Suse, OpenSuse, Arch Linux etc., on x86, ARM, PowerPC, MIPS...
| Collective service to build packages for Linux |
1,660,032,310,000 |
Here is my codelite.spec file. It compiles the sources fine, but then it gives this error (and yes I am including a few extra lines to give context):
Processing files: codelite-10.0-1.fc25.x86_64
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.zYPKNH
+ umask 022
+ cd /home/username/rpmbuild/BUILD
+ cd codelite-10.0
+ DOC... |
It's the %filter_from_requires on line 60 that is wrong.
According to EPEL:Packaging Autoprovides and Requires Filtering:
The %filter_from_requires macro is used to filter "requires"; it does for requires what the %filter_from_provides macro does for provides and is invoked in the same fashion.
Regarding the %filter... | How do I fix this spec file: it keeps giving me sed errors yet the only sed is long before the error occurs? |
1,660,032,310,000 |
I am making a new package from a project that I've been working on for practice. I've been using git, and I've noticed similarities between it and the Debian packing system. What's confusing me is when I make a change to any of the files and do not manually update the .orig.tar.xz file, dpkg wants me to add a patch. M... |
For the now standard Debian source format 3.0 (quilt), the correct procedure when you make changes to the original/upstream source, is to add corresponding patches in the debian/patches directory, not to .orig.tar.xz. This is commonly done using quilt, but you can alternatively use a "proper" version control system li... | Debian packaging: whats the difference between patches and changelog? |
1,660,032,310,000 |
I try to create a flatpak application for Instant meshes in particular the manifest is the following:
id: org.flatpak.InstantMeshes
runtime: org.gnome.Platform
runtime-version: "44"
sdk: org.gnome.Sdk
command: InstantMeshes
desktop-file-name-suffix: " (Nightly)"
finish-args:
- --share=ipc
- --socket=x11
- --sock... |
There are any posibilities to instroduce zenity into /usr/bin folder?
Not really, the things that flatpak exports for usage belong in /app. You're solving the wrong end:
The error here is that your software expects zenity in a specific folder. Fix that – and you're done. And fixing it is easy; find the script that s... | Put zenity to flatpak /usr/bin folder |
1,660,032,310,000 |
I am learning how to create deb packages for a small project of mine. I have been able to create the deb package for the binary. So far so good. After the process is finished I can see this:
$ dpkg -c gitmod_0.10-1_amd64.deb
drwxr-xr-x root/root 0 2024-06-01 13:57 ./
drwxr-xr-x root/root 0 2024-06-01 1... |
Package names are codified: they contain the package name, version (including Debian revision), and architecture. So the only way to add a suffix in the style you’re after is to add it to the Debian revision.
For example, you could specify 0.10-1+deb11u1 in debian/changelog for your Bullseye package, and 0.10-1+deb12u... | creating deb packages - is there an standard way to setup a suffix to the final deb packages? |
1,660,032,310,000 |
During the installation of mysql-server on raspbian buster, apt say that mysql-server isn't available and suggest mariadb-server-10.0 as replacement.
How apt know if a package is replaced with another one? In other word where this information should be set in during the package creation?
Package mysql-server is not av... |
If you run apt show mariadb-server-10.3 (I have newer version), you will see this:
Package: mariadb-server-10.3
Version: 1:10.3.27-0+deb10u1
Priority: optional
Section: database
Source: mariadb-10.3
Maintainer: Debian MySQL Maintainers <[email protected]>
Installed-Size: 66,6 MB
Provides: virtual-mysql-server
Pre-Depe... | How apt know if an obsolete package is replaced by another one? |
1,660,032,310,000 |
So lately I've been trying to find a way to make an apt or a .deb package to make it easier for people to install and use packages without using the commander line but, to even start doing that I need to know how to even make a package!
Questions
How do you make a package?
Is there an IDE that makes it easier to mak... |
How do you make a package?
I have three solutions for you:
dh_make. This is the way most official debian archives are put together. If you're having problems following along with the official guides, it's not because they aren't well written (they are), it's just a complicated process and so I'm not sure that a vi... | How do you make a apt or .deb Package for debian? [closed] |
1,660,032,310,000 |
I am attempting to understand the use of a .srpm aka "source rpm" Red Hat Package Manager package.
From what I understand so far, a .srpm is different from a standard .rpm in that it provides the source code and is commonly used during development. I am puzzled on why this is useful because if I run rpm2cpio ./myrpm-1... |
I have never heard of a RPM that would pull down a source code. Maybe there are some which do that, but I would say they are rare. srpm packages include source code and instructions to build rpm packages. rpm packages have compiled code, which you can run and they do not include sources. There are exceptions. For inst... | How is a source RPM different from unpacking an RPM with rpm2cpio and cpio? |
1,660,032,310,000 |
I've built a rpm package using rpmbuild, and the package has the following dependencies:
51f32ecb00b7:/rpm # rpm -qpR pkg.rpm
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.17)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.5)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
l... |
My question is: Why RPM is giving me the error if I have libssl.so.1.1 installed?
Your RPM requires libssl.so.1.0.0, not libssl.so.1.1 (see below).
My RPM package depends on libssl.so.1.0.0, so shouldn't it be compatible? As far as I know, the first number defines the ABI compatibility between the shared objects, s... | Why RPM doesn't accept my shared object as dependency? |
1,660,032,310,000 |
I have a script built just a way to learn bash and it uses jq for json parsing suppose someone else downloads it and runs the file, will bash automatically prompt the user to install jq or should I include in the script to install it?
Yes I understand that the terminal will probably throw jq: command not found but is ... |
You should leave it. Typically, you would only install dependencies when creating a package for a specific package manager, not as part of a program or script.
There are so many different package managers, each with their own way of handling dependencies, and you want to let people choose which one to install with. Th... | Should I include code to install the packages that my script requires? |
1,660,032,310,000 |
So, I am somewhat puzzled by the rpmbuild process. I'm now maintaining a slew of scripts previously created and while most work, there are enough differences between them that finding a consistent approach is just not happening.
Some individually copy files (very tedious) to a temp location prior
to packaging.
Some... |
The files that are to be packaged need to be installed/isolated into a shadow tree.
This is usually done by overriding]DESTDIR like
make DESTDIR=%{buildroot} install
in the %install section.
| RPM %install section |
1,660,032,310,000 |
I know how to extract a package, make some minor changes, and repackage it. I wanted to know if there was anything special you'd have to do if you were to repackage a deb package so it was compatible with an older OS version.
For example, I want to upgrade xyz package on Ubuntu 12 but xyz package is only available on... |
You'll get unmet dependencies if you want to take package from newer system and install on older one. You can check dependencies in the control file in Depends: section. You can try to resolve dependencies by upgrading them, but by doing so you can break other applications which depend on old versions. If you'll mana... | How do you repackage a deb package for an older OS? |
1,660,032,310,000 |
I have CentOS and Red hat enterprise Linux running, where I have now working Google Apps Engine and related other Python web applications.
Every week or depending on any Google Apps Engine latest release my working setup does not work any longer (right now its working but after one week it won't work again and its ve... |
You can try enabling yum's rollback feature as follows:
vi /etc/yum.conf
add this line to file: tsflags=repackage
vi /etc/rpm/macros (create if non-existent)
add this line to file: %_repackage_all_erasures 1
Now you can use rpm to rollback to different restore points:
$ rpm -Uvh –rollback ’21:00′
$ rpm -Uvh –rollbac... | CentOS - acts abnormal every week and causes my whole setup to be down, how can I rollback / restore back to one week? |
1,660,032,310,000 |
If I'm writing a Debian package maintainer script (such as a pre-install script) for a package I create, how can I make the script determine if it is supposed to be running in non-interactive mode (e.g. if apt-get install was invoked with -y, and things like that)?
|
If your maintainer scripts need to interact with the user running the installation, the recommended way to proceed is to use debconf; see Conditional file and directory installation in Debian Packages for pointers. This might seem complicated but it does bring a number of benefits — not only does debconf handle non-in... | Check for non-interactive mode in Debian package maintainer scripts |
1,660,032,310,000 |
I'm making a file manager system for managing my projects. My package is named filesystem. I need a config file that stores the path to the root of my file system.
I think I need to create a file /etc/filesystem/root.conf and add it to DEBIAN/conffiles. If the file doesn't exist I want to prompt the installer for a ro... |
To prompt the user for a root directory, you should use debconf. This will allow you to prompt the user, while still allowing pre-configuration, and explicit re-configuration using dpkg-reconfigure. See Configuration management with debconf and man debconf-devel for details, in particular Config file handling in the l... | Common practice for config files |
1,660,032,310,000 |
As I understand it, debian packages should be named NAME_VERSION_ARCHITECTURE.
but when I use git as version control it and I rename the folder, it threats all files as deleted and then new.
Is there a workaround to the NAME_VERSION_ARCHITECTURE name?
|
The “name_version_arch” scheme applies to binary packages, not source packages or VCS repositories. You can name your git repository whatever you like, although it’s common practice to name it after the source package name. See for example one of my source packages.
The git repository shouldn’t contain the top-level d... | How should versioning of debian packages work with git? |
1,660,032,310,000 |
I can't seem to work out how to build GNU Hello on Ubuntu 22.04. To reproduce, start a Docker container using docker run --interactive --rm --tty ubuntu:22.04, then run the following:
apt-get update
apt-get install -y debhelper-compat dpkg-dev wget
cd "$(mktemp --directory)"
wget http://archive.ubuntu.com/ubuntu/pool/... |
Yes, you need to extract the main tarball too:
tar xf hello_2.10.orig.tar.gz
cd hello*/
tar xf ../hello_2.10-2ubuntu4.debian.tar.xz
dpkg-buildpackage
apt-get source hello will take care of downloading and extracting the source package for you (if the source repositories are configured), and apt-get build-dep will tak... | How to build GNU Hello .deb? |
1,660,032,310,000 |
I'm often in the situation where I backport some fedora-packaged software to CentOS, or forward-port something from an older version of EPEL to Fedora, or vice versa.
How can I do that with the least amount of effort?
|
In essence, that's what distgit is for: keeping package specs coordinated and available. So, let's use it.
We'll need to set up our system to be able to build packages:
# only on CentOS and other RHEL derivatives:
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled powertools
sudo dnf ... | I need a package for my version of RHEL/EPEL/CentOS/Fedora, but it's only packaged for other versions of Redhatoids |
1,660,032,310,000 |
I need to get the list of sources packages that doesn't have a binary packages on Debian.
Listing all sources packages may be an answer, so we can get the diff between the available binary and the available sources package.
|
As far as I’m aware, all source packages in Debian must produce at least one binary package on at least one architecture.
To count the number of binary packages produced by the source packages available in the system’s configured source repositories (deb-src lines), run
awk '/Package:/{p=$2;b=0} /Binary:/{b=NF - 1} /^... | List all available sources packages that doesn't have a binay packages |
1,299,665,584,000 |
I am always very hesitant to run kill -9, but I see other admins do it almost routinely.
I figure there is probably a sensible middle ground, so:
When and why should kill -9 be used? When and why not?
What should be tried before doing it?
What kind of debugging a "hung" process could cause further problems?
|
Generally, you should use kill (short for kill -s TERM, or on most systems kill -15) before kill -9 (kill -s KILL) to give the target process a chance to clean up after itself. (Processes can't catch or ignore SIGKILL, but they can and often do catch SIGTERM.) If you don't give the process a chance to finish what it... | When should I not kill -9 a process? |
1,299,665,584,000 |
It often baffles me that, although I have been working professionally with computers for several decades and Linux for a decade, I actually treat most of the OS' functionality as a black box, not unlike magic.
Today I thought about the kill command, and while I use it multiple times per day (both in its "normal" and -... |
Sending kill -9 to a process doesn't require the process' cooperation (like handling a signal), it just kills it off.
You're presuming that because some signals can be caught and ignored they all involve cooperation. But as per man 2 signal, "the signals SIGKILL and SIGSTOP cannot be caught or ignored". SIGTERM ca... | How does Linux "kill" a process? |
1,299,665,584,000 |
I know that pkill has more filtering rules than killall. My question is, what is the difference between:
pkill [signal] name
and
killall [signal] name
I've read that killall is more effective and kill all processes and subprocesses (and recursively) that match with name program. pkill doesn't do this too?
|
The pgrep and pkill utilities were introduced in Sun's Solaris 7 and, as g33klord noted, they take a pattern as argument which is matched against the names of running processes. While pgrep merely prints a list of matching processes, pkill will send the specified signal (or SIGTERM by default) to the processes. The co... | What's the difference between pkill and killall? |
1,299,665,584,000 |
Is there any package which shows PID of a window by clicking on it?
|
Yes. Try xprop and you are looking for the value of _NET_WM_PID:
xprop _NET_WM_PID | cut -d' ' -f3
{click on window}
| Getting a window's PID by clicking on it |
1,299,665,584,000 |
If you check the STAT column in above image you will see Ss S S< SN and R+
What does this indicates ? Process states.
If yes,Then what is the significance of 'Ss S< SN and R+'?
|
These are indeed the process states. Processes states that ps indicates are:
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx ... | What does this process STAT indicates? |
1,299,665,584,000 |
The UNIX system call for process creation, fork(), creates a child process by copying the parent process. My understanding is that this is almost always followed by a call to exec() to replace the child process' memory space (including text segment). Copying the parent's memory space in fork() always seemed wasteful... |
It's to simplify the interface. The alternative to fork and exec would be something like Windows' CreateProcess function. Notice how many parameters CreateProcess has, and many of them are structs with even more parameters. This is because everything you might want to control about the new process has to be passed ... | Why is the default process creation mechanism fork? |
1,299,665,584,000 |
For example, we'd like to see:
PROCESS IF TX RX FILE(regular) R/W
prog1 eth0 200kB/s 12kB/s -- --
wlan0 12kB/s 100kB/s -- --
-- -- -- file1 R
-- -- -- file2 R... |
As far as I know, no. What you're trying to accomplish is possible combining multiple commands as you're currently doing, though I don't know of other apps that would provide you data easier to parse (ed: another answer suggested iftop which I did not know added a pipe-able single line text output mode). With some cle... | Is there a top-like command that shows the network bandwidths and file accesses of running processes |
1,299,665,584,000 |
At first, the question seems to be a little bit silly/confusing as the OS does the job of managing process execution.
However, I want to measure how much some processes are CPU/IO-bound and I feel like my OS is interfering on my experiments with, for instance, scheduled OS processes.
Take as an example the following s... |
You have a kernel option configuration where a CPU won't be used by the OS, it is called isolcpus.
isolcpus — Isolate CPUs from the kernel scheduler.
Synopsis isolcpus= cpu_number [, cpu_number ,...]
Description Remove the specified CPUs, as defined by the cpu_number
values, from the general kernel SMP balancing ... | How to ensure exclusive CPU availability for a running process? |
1,299,665,584,000 |
When I used killall -9 name to kill a program, the state become zombie. Some minutes later, it stopped really.
So, what's happening during those minutes?
|
The program actually never receives the SIGKILL signal, as SIGKILL is completely handled by the operating system/kernel.
When SIGKILL for a specific process is sent, the kernel's scheduler immediately stops giving that process any more CPU time for running user-space code. If the process has any threads executing user... | What does a program do when it's sent SIGKILL signal? |
1,299,665,584,000 |
The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used".
How can I understand what a "subreaper" is?
|
This was implemented to the Linux kernel 3.4 as a flag of the system call prctl().
From the prctl(2) manpage:
[...] A subreaper fulfills the role of init(1) for its descendant
processes. Upon termination of a process that is orphaned (i.e., its
immediate parent has already terminated) and marked as having a
sub... | What is a "subreaper" process? |
1,299,665,584,000 |
Since google chrome/chromium spawn multiple processes it's harder to see how much total memory these processes use in total.
Is there an easy way to see how much total memory a series of connected processes is using?
|
Given that google killed chrome://memory in March 2016, I am now using smem:
# detailed output, in kB apparently
smem -t -P chrom
# just the total PSS, with automatic unit:
smem -t -k -c pss -P chrom | tail -n 1
to be more accurate replace chrom by full path e.g. /opt/google/chrome or /usr/lib64/chromium-browser
thi... | Get chrome's total memory usage |
1,299,665,584,000 |
I have to copy files on a machine. And the data is immensely large. Now servers need to serve normally, and there are usually a particular range of busy hours on those.
So is there a way to run such commands in a way that if server hits busy hours, it pauses process, and when it gets out of that range, it resumes it?
... |
Yes, you need to acquire the process id of the process to pause (via the ps command), then do:
$> kill -SIGSTOP <pid>
The process will then show up with Status "T" (in ps).
To continue, do a:
$> kill -CONT <pid>
| Is there a way to pause a running process on Linux systems and resume later? |
1,299,665,584,000 |
I have a general question, which might be a result of misunderstanding of how processes are handled in Linux.
For my purposes I am going to define a 'script' as a snippet of bash code saved to a text file with execute permissions enabled for the current user.
I have a series of scripts that call each other in tandem. ... |
In Unix, most editors work by creating a new temporary file containing the edited contents. When the edited file is saved, the original file is deleted and the temporary file renamed to the original name. (There are, of course, various safeguards to prevent dataloss.) This is, for example, the style used by sed or per... | What happens if you edit a script during execution? |
1,299,665,584,000 |
I'm looking for a way to limit a processes disk io to a set speed limit. Ideally the program would work similar to this:
$ limitio --pid 32423 --write-limit 1M
Limiting process 32423 to 1 megabyte per second hard drive writing speed.
|
That is certainly not trivial task that can't be done in userspace. Fortunately, it is possible to do on Linux, using cgroup mechanizm and its blkio controller.
Setting up cgroup is somehow distribution specific as it may already be mounted or even used somewhere. Here's general idea, however (assuming you have prope... | How to Throttle per process I/O to a max limit? |
1,299,665,584,000 |
I have script including multiple commands. How can I group commands to run together ( I want to make several groups of commands. Within each group, the commands should run in parallel (at the same time). The groups should run sequentially, waiting for one group to finish before starting the next group)
... i.e.
#!/bin... |
The commands within each group run in parallel, and the groups run sequentially, each group of parallel commands waiting for the previous group to finish before starting execution.
The following is a working example:
Assume 3 groups of commands as in the code below. In each group the three commands are started in the... | Run commands in parallel and wait for one group of commands to finish before starting the next |
1,299,665,584,000 |
I was slightly confused by:
% vim tmp
zsh: suspended vim tmp
% kill %1
% jobs
[1] + suspended vim tmp
% kill -SIGINT %1
% jobs
[1] + suspended vim tmp
% kill -INT %1
% jobs
[1] + suspended vim tmp
So I resigned to just "do it myself" and wonder why later:
% fg
[1] - continued vim tmp
Vim: Caught deadly ... |
vi-vi-vi is of the devil. You must kill it with fire. Or SIGKILL:
kill -KILL %1
The builtin kills are kind enough to send SIGCONT to suspended processes so that you don't have to do it yourself, but that won't help if the process blocks the signal you're sending or if handling the signal causes the processes to beco... | Kill a suspended process? |
1,299,665,584,000 |
to find the PID of the process to kill use :
pgrep <process command>
I then use the kill command to kill the PID returned by pgrep <process command>
kill <PID>
Can these commands be combined into one so can kill the PID or PID's returned by pgrep <process command> ? Or is there a method kill multiple processes by c... |
You can use pkill:
pkill httpd
You may also want to use process substitution(although this isn't as clear):
kill $(pgrep command)
And you may want to use xargs:
pgrep command | xargs kill
| How to kill multiple processes |
1,299,665,584,000 |
What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
|
top is mostly used interactively (try reading man page or pressing "h" while top is running) and ps is designed for non-interactive use (scripts, extracting some information with shell pipelines etc.)
| What is the difference between ps and top command? |
1,299,665,584,000 |
I am evaluating the expression 6^6^6 using python and bc separately.
The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as
real 0m0.067s
user 0m0.050s
sys 0m0.011s
And then, I ran the command time echo 6^6^6 | bc which gave me the following o... |
Python imports a large number of files at startup:
% python -c 'import sys; print len(sys.modules)'
39
Each of these requires an even greater number of attempts at opening a Python file, because there are many ways to define a module:
% python -vv -c 'pass'
# installing zipimport hook
import zipimport # builtin
# in... | python vs bc in evaluating 6^6^6 |
1,299,665,584,000 |
I started hosting sites a while back using Cherokee. For external sources (FastCGI, etc) it has an option to launch the process if it can't find one running on the designated socket or port. This is great because it means if PHP or a Django site falls over (as they occasionally do) it restarts it automatically.
On a n... |
How about daemontools and specifically the supervise tool
supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.
| Ensure a process is always running |
1,299,665,584,000 |
Transmission is intermittently hanging on my NAS. If I send SIGTERM, it doesn't disappear from the process list and a <defunct> label appears next to it. If I send a SIGKILL, it still doesn't disappear and I can't terminate the parent because the parent is init. The only way I can get rid of the process and restart... |
You cannot kill a <defunct> process (also known as zombie process) as it is already dead. The system keeps zombie processes for the parent to collect the exit status. If the parent does not collect the exit status then the zombie processes will stay around forever. The only way to get rid of those zombie processes are... | How can I kill a <defunct> process whose parent is init? |
1,299,665,584,000 |
I'm learning CentOS/RHEL and currently doing some stuff about process management.
The RHCSA book I'm reading describes running kill 1234 as sending SIGQUIT. I always thought the kill command without adding a switch for signal type should default to kill -15
SIGTERM is kill -15 and SIGKILL is kill -9, right?
Does CentO... |
No, they're not the same. The default action for both is to terminate the process, but SIGQUIT also dumps core. See e.g. the Linux man page signal(7). kill by default sends SIGTERM, so I can only imagine that the mention of SIGQUIT being default is indeed just a mistake. That default is in POSIX, and so are the number... | Is SIGQUIT the same as SIGTERM? |
1,299,665,584,000 |
As I understand it, a zombie process has died but still exists as a placeholder in the process table until its parent (or init if the zombie is itself an orphan) checks its exit status.
And my understanding of orphan processes is they are processes that are still alive and running but whose parent has died.
Since a zo... |
As I understand it, a zombie process has died but still exists as a placeholder in the process table until its parent (or init if the zombie is itself an orphan) checks its exit status.
Correct.
And my understanding of orphan processes is they are processes that are still alive and running but whose parent has died... | Can a zombie have orphans? Will the orphan children be disturbed by reaping the zombie? |
1,299,665,584,000 |
I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they aren't showing all of the running processes. Is there another command which will show all running processes or is there a... |
From the ps man page:
-e Select all processes. Identical to -A.
Thus, ps -e will display all of the processes. The common options for "give me everything" are ps -ely or ps aux, the latter is the BSD-style. Often, people then pipe this output to grep to search for a process, as in xenoterracide's answe... | How can I see what processes are running? |
1,299,665,584,000 |
Don't normally post here but I am ripping my hair out over this one.
I have a Python script that forks when it launches, and is responsible for starting a bunch of other processes. This script used to be launched at startup via sysvinit, but recently I upgraded to Debian Jessie so have adapted it to launch via system... |
I managed to fix this simply by setting KillMode to process instead of control-group (default). Thanks all!
| Systemd and process spawning: child processes are killed when main process exits |
1,299,665,584,000 |
How can i view the priority of a specific process ?
|
The top command lists the priority of running processes under the PR heading. If you have it installed, you can also search for a process and sort by priority in htop.
| What is a command to find priority of process in Linux? |
1,299,665,584,000 |
I want to run two commands simultaneously in bash on a Linux machine. Therefore in my ./execute.sh bash script I put:
command 1 & command 2
echo "done"
However when I want to stop the bash script and hit Ctrl+C, only the second command is stopped. The first command keeps running.
How do I make sure that the complet... |
If you type
command 1 & command 2
this is equal to
command 1 &
command 2
i.e. this will run the first command in background and then runs the second command in foreground. Especially this means, that your echo "done" is printed after command 2 finished even if command 1 is still running.
You probably want
command 1 ... | Ctrl-C with two simultaneous commands in bash |
1,299,665,584,000 |
I am reading up on Linux processes from The Linux Documentation Project: https://www.tldp.org/LDP/tlk/kernel/processes.html
Processes are always making system calls and so may often need to wait. Even so, if a process executes until it waits then it still might use a disproportionate amount of CPU time and so Linux ... |
The short answer is yes. All practical approaches to preemption will use some sort of CPU interrupt to jump back into privileged mode, i.e. the linux kernel scheduler.
If you look at your /proc/interrupts you'll find the interrupts used in the system, including timers.
Note that linux has several different types of sc... | How does Linux accomplish pre-emptive scheduling? |
1,299,665,584,000 |
I'm trying to map Linux process state codes (as in ps) to states in the OS state diagram but I can't seem to map them. Is it because Linux process states don't necessarily match the theoretical OS state diagram? Specifically, I am unsure where D/S/T/I fit in the diagram.
ps process state codes from the man page:
PROC... |
Short answer:
The states (roughly) map like this:
State
Meaning
D
Blocked
I
Blocked
R
Waiting or Running
S
Blocked
T
Blocked (more or less)
t
Blocked (more or less)
W
Blocked (obsolete since Linux 1.1.30)
X
Terminated
Z
Terminated
Long answer:
The externally visible process state codes in Li... | Process states in OS theory vs in Linux |
1,299,665,584,000 |
According to the man page, and wikipedia; nice ranges from -20 to 20.
Yet when I run the following command, I find some processes have a non numerical value such as (-). See the sixth column from the left with title 'NI'.
What does a niceness of (-) indicate?
ps axl
F UID PID PPID PRI NI VSZ RSS WCHAN... |
What does a niceness of (-) indicate?
Notice those also have a PRI score of -100; this indicates the process is scheduled as a realtime process. Realtime processes do not use nice scores and always have a higher priority than normal ones, but still differ with respect to one another.
You can view details per proces... | What does a niceness value of (-) mean? |
1,299,665,584,000 |
I use pgrep from procps-3.3.10.
If I have executable aout_abcdefgh_ver27,
then
pgrep aout_abcdefgh_ver27
returns nothing, while ps aux | grep aout_abcdefgh_ver27 returns the expected result:
ps aux | grep aout_abcdefgh_ver27
evgeniy 14806 0.0 0.0 4016 672 pts/8 S 12:50 0:00 ./aout_abcdefgh_ver27
evge... |
The problem is that by default, pgrep only searches the process name. The name is a truncated version of the entire command. You can see what the name is by looking at /proc/PID/status where PID is the process ID of the relevant process. For example:
$ ./aout_abcdefgh_ver27 &
[1] 14255 ## this is th... | pgrep full match not work, only part, why? |
1,299,665,584,000 |
For catastrophe testing scenarios on out server environment we're looking for an easy way to make a process stuck in D (uninterruptible sleep) state.
Any easy ways? An example C sample code would be a plus :)
Edit - the first answer is semi-correct, as the process is shown to be in D state, but it still receives sign... |
I had the same problem and resolved it by creating a kernel module that gets stuck in D state.
As I don't have any experience in modules, I took the code from this turorial with some modifications found someplace esle.
The result is a device on /dev/memory that gets stuck on read but can be waken up writting on it (it... | Simulate an unkillable process in D state |
1,299,665,584,000 |
I'm writing a Perl script that parses logfiles to collect PIDs and then checks whether that PID is running. I am trying to think of the best way to make that check. Obviously, I could do something like:
system("ps $pid > /dev/null") && print "Not running\n";
However, I'd prefer to avoid the system call if possible. I... |
The perl function kill(0,$pid) can be used.
If the return code is 1 then the PID exists and you're allowed to send a signal to it.
If the return code is 0 then you need to check $!. It may be EPERM (permission denied) which means the process exists or ESRCH in which case the process doesn't exist.
If your checking co... | How should I check whether a given PID is running? |
1,299,665,584,000 |
I can't find any pattern when I look at the numbering of PIDs in process table (ps -a), as the PIDs are not subsequent numbers and sometimes there are large "gaps" between those numbers.
Is it because there may be some processes that run for a short time and they reserve some PIDs? Is there some range, after which th... |
Yes on both counts.
Many processes are short lived. They get a PID, run, finish, and the PID disappears from the process table.
Processes sometimes only live for a fraction of a second!
Often when programs start they run numerous commands as part of checking the system and initializing their environment.
The maximum ... | How are the processes in UNIX numbered? |
1,299,665,584,000 |
Given a commodity PC, we would like to use it to execute some tasks in the background round the clock.
Basically, we would like to have commands like:
add-task *insert command here*
list-tasks
remove-task(s)
The added tasks should simply be put in a queue and executed one after another in the background (keeping runn... |
There's a standard batch command that does more or less what you're after. More precisely, batch executes the jobs when the system load is not too high, one at a time (so it doesn't do any parallelization). The batch command is part of the at package.
echo 'command1 --foo=bar' | batch
echo 'command2 "$(wibble)"'... | Simple queuing system? |
1,299,665,584,000 |
Is there a way to know which cores currently have a process pinned
to them?
Even processes run by other users should be listed in the output.
Or, is it possible to try pinning a process to a core but
fail in case the required core already has a process pinned to it?
PS: processes of interest must have bin pinned to th... |
Answer to myself:
hwloc-bind from Linux (and homebrew for Macs) package hwloc.
Cf. https://www.open-mpi.org/projects/hwloc/tutorials/20130115-ComPAS-hwloc-tutorial.pdf for some doc.
| Linux: how to know which processes are pinned to which core? |
1,299,665,584,000 |
I had issued the ps -ef|grep java command and this is one of the entries that I got :
subhrcho 875 803 0 Jan23 pts/5 00:02:27 [java] <defunct>
What is <defunct> implying here ? What state is that process is that process with PID=875 in ?
|
From the ps manpage:
Processes marked <defunct> are dead processes (so-called "zombies")
that remain because their parent has not destroyed them properly.
These processes will be destroyed by init(8) if the parent process
exits.
| What does <defunct> mean in the output of ps? |
1,299,665,584,000 |
Consider a shell script executed by Sh, not Bash (and I can't change it, and can't use a shebang, it's ignored). The & operator works, but disown $! does not and makes Sh complains “disown: not found”.
How do I detach a background process from specifically Sh? I mean, doing from Sh the same as disown do from Bash.
|
First let's see what Bash's disown command does. From Bash manual:
The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped. Stopped jobs are sent SIGCONT to ensure that they receive the SIGHUP. To prevent the shell from sending the S... | Detach a process from Sh (not Bash) or “disown” for Sh (not Bash) |
1,299,665,584,000 |
suspend is a builtin command in Bash. When would you naturally use this command and find it useful?
|
Let's say you lack both GNU screen and tmux (and X11, and virtual consoles) but want to switch between a login shell and another interactive shell.
You would first login on the console, and then start a new shell, temporarily blocking the login shell. To get the login shell back to do some work there, you'd do suspen... | What is a practical example of using the suspend command in Bash? |
1,299,665,584,000 |
When I run top -H, I see that my multiple mysql threads all have the same PID. However, in ps -eLf I see each one has a different PID:
ps -eLf
UID PID PPID LWP C NLWP STIME TTY TIME CMD
mysql 1424 1 1424 0 17 18:41 ? 00:00:00 /usr/sbin/mysqld
mysql 1424 1 1481 0 17 18... |
They are actually showing the same information in different ways. This is what the -f and -L options to ps do (from man ps, emphasis mine):
-f Do full-format listing. This option can be combined with many
other UNIX-style options to add additional columns. It also causes the command arguments to... | Why do top and ps show different PIDs for the same processes? |
1,299,665,584,000 |
We can issue CTRL+Z to suspend any jobs in Unix and then later on bring them back to life using fg or bg. I want to understand what happens to those jobs that are suspended like this ? Are they killed/terminated ? In other words what is the difference between killing and suspending a process ?
|
The jobs are not killed, they are suspended. They remain exactly as they are at the time of the suspension: same memory mapping, same open file, same threads, … It's just that the process sits there doing nothing until it's resumed. It's like when you pause a movie. A suspended process behaves exactly like a process t... | What happens to suspended jobs in unix? |
1,299,665,584,000 |
Let's assume process runs in ulimited environment :
(
ulimit ... -v ... -t ... -x 0 ...
./program
)
Program is terminated.
There might be many reasons : memory/time/file limit exceeded ; just simple segfault ; or even normal termination with return code 0.
How to check what was the reason of program termination, wit... |
Generally speaking, I don't think you can unfortunately. (Some operating systems might provide for it, but I'm not aware of the ones I know supporting this.)
Reference doc for resource limits: getrlimit from POSIX 2008.
Take for example the CPU limit RLIMIT_CPU.
If the process exceeds the soft limit, it gets sent a S... | How to check, which limit was exceeded? (Process terminated because of ulimit. ) |
1,299,665,584,000 |
In linux, from /proc/PID/stat, I can get the start_time (22:nd) field, which indicates how long after the kernel booted the process was started.
What is a good way to convert that to a seconds-since-the-epoch format? Adding it to the btime of /proc/stat?
Basically, I'm looking for the age of the process, not exactly ... |
Since version 3.3.0, the ps of procps-ng on Linux has a etimes output field that gives you the elapsed time in seconds since the process was started (which by the way is not necessarily the same thing as the elapsed time since the last time that process executed a command (if at all!) (the time that process has been r... | Get process age from command line [duplicate] |
1,299,665,584,000 |
I have multiple serial ports to each of which devices are connected. They are listed as /dev/ttyUSB*. Now, I need to make sure using a python script that no other process is using any of these before I run a kermit script (so that access is not denied) login_init. I tried ps and lsof commands. lsof gave the following ... |
killall expects a substring of the program's name as argument. To kill a process by its process ID, use kill.
You can directly kill all the processes that have a file open with the command fuser.
fuser -k /dev/ttyUSB9
| Find and kill the process that is using a serial port |
1,299,665,584,000 |
If I begin a process and background it in a terminal window (say ping google.com &), I can kill it using kill %1 (assuming it is job 1).
However if I open another terminal window (or tab) the backgrounded process is not listed under jobs and cannot be killed directly using kill.
Is it possible to kill this process... |
Yes, all you need to know is the process id (PID) of the process. You can find this with the ps command, or the pidof command.
kill $(pidof ping)
Should work from any other shell. If it doesn't, you can use ps and grep for ping.
| How can I kill a job that was initiated in another shell (terminal window or tab)? |
1,299,665,584,000 |
I know there are a million questions on getting the process ID, but this one seems to be unique. Google has not given me the answer, so I hope stackexhange will help rather than close this question.
When Java is involved it seems trickier to find a process ID (pgrep doesn't work afaik).
Furthermore, I need to automat... |
By default, pgrep only matches the command, not the arguements. To match the full command line, you need the -f option.
$ pgrep -f java_app
From the pgrep manpage:
-f The pattern is normally only matched against the process name. When -f is set, the full command line is used
| Find the process id of a java application in a bash script (to see if the target application is already running) |
1,358,935,391,000 |
I know I can kill any process with kill -9 command . But sometimes i see that even if I have terminated a program with CTRL+C , the process doesn't get killed . So I want to know the difference between kill -9 vs CTRL+C
|
^C send the interrupt signal, which can be handled by a program (you can ignore it)
kill -9 send the sigkill signal which kills the program that you can't handle.
That's why you can't kill some programs with ^C
| What is the difference between exiting a process via Ctrl+C vs issuing a kill -9 command? |
1,358,935,391,000 |
I have a eight core machine. How can I find out how many cores are used by processes that I see in htop?
|
In htop, press F2 or Sto enter setup, then use the arrows to navigate the Columns->Available Columns menu, select PROCESSOR and Enterto add a processor column. Then q to get back to the main screen.
| How to find how many cores a process is using? |
1,358,935,391,000 |
I have often issues with processes stuck in D state, due to NFS shares behind firewalls. If I lose connections, processes get stuck in D state and I can't kill them. The only solution becomes hard reboot. I was wondering if there are any other ways but all the solutions and information I can find is "you just can't ki... |
Killing a process while it's in a system call is possible, and it mostly works. What's difficult is to make it work all the time. Going from 99.99% to 100% is the difficult part.
Normally, when a process is killed, all the resources that it uses are freed. If there's any I/O going on with the process, the code doing t... | Why can't we kill uninterruptible D state process? |
1,358,935,391,000 |
Possible Duplicate:
What if ‘kill -9’ does not work?
I guess its a bit late to ask this, but for future reference;
I was called to look at a server today after a customer was reporting that connecting with ssh was slow and executing commands was also slow (with some not working at all).
After logging in I could t... |
I executed tail -n 50 /var/log/message and sadly I no longer have the
output but it looked like there had been a serious problem. Lots of
memory locations printed in HEX and presumably their contents
(incomprehensibly ramblings) on the right.
It could have been nearly anything, and the contents of these kernel... | kill -9 hangs, unable to kill process (murder proof process) [duplicate] |
1,358,935,391,000 |
I read in an online flash card that the command is:
pkill -u bob $(pgrep -u bob)
However, I think this is wrong. I think it's saying:
Kill all the processed owned by bob, and 4572\n4600
Because:
[bob@localhost ~]$ pgrep -u bob
4572
4600
Also, it gives an error:
[bob@localhost ~]$ pkill -u bob $(pgrep -u bob)
pkil... |
You Are Correct
Wrong: pkill -u bob $(pgrep -u bob)
Correct: pkill -u bob
The flash card probably meant to show:
kill $(pgrep -u bob)
which would kill all of the processes returned by pgrep -u bob.
| How to kill all processes owned by `user` on Centos 7? [duplicate] |
1,358,935,391,000 |
I am running debian right now and sometimes I need to kill java manually from the terminal, but when I try kill #pid# or pkill java nothing happens. No console output (ok, that's normal) and java is still running (not normal). The only way to kill it is to restart the PC.
Any suggestions?
|
Maybe its ignoring the signal for some reason. Did you try kill -9?
But please note: kill -9 cannot be ignored or trapped. If a process sees signal 9, it has no choice but to die. It can't do anything else - not even gracefully clean up its files.
| 'kill java' doesn't kill java |
1,358,935,391,000 |
A thing I frequently want to do is launch some long running process or server as my own non-privileged user and then have a way to tell if it's still running and restart it if not.
So for example I might set a cron job that runs every so often checking if my process is running and restart it if it has crashed. This is... |
deamontools you mentioned work just fine as user. See https://cr.yp.to/daemontools/supervise.html
Update - solutions
as per the above suggestion the OP got this working using the svscan program from daemontools after trying two different methods:
Put it in like this a modern crontab: @reboot /usr/bin/svscan $HOME/.lo... | Is there a utility for daemonizing processes as non-privileged user? |
1,358,935,391,000 |
I've realised recently that the kill utility can send any signal I want, so when I need to SIGKILL a process (when it's hanging or something), I send a SIGSEGV instead for a bit of a laugh (kill -11 instead of kill -9.)
However, I don't know if this is bad practice. So, is kill -11 more dangerous than kill -9? If so, ... |
The SIGSEGV signal is sent by the kernel to a process that has made an invalid virtual memory reference (segmentation fault).
One way sending a SIGSEGV could be more "dangerous" is if you kill a process from a filesystem that is low on space. The default action when a process receives a SIGSEGV is to dump core to a fi... | Is there any danger in using kill -11 instead of kill -9? |
1,358,935,391,000 |
I'm trying to properly emulate POSIX signals handling and job control for my pet operating system, but it's not clear to me what should happen to a session after the session leader exits.
I cannot find documentation related to what happens to the session and its process if, for example, a child kills the session leade... |
You are not the only one puzzled by POSIX sessions; Lennart Poettering (he of systemd fame) is puzzled too.
As far as anybody can tell, when a session leader dies, init inherits the orphaned session and
All session member processes in the foreground process group (if any) receive a SIGHUP.
Session member processes w... | What happens to a unix session when the session leader exits? |
1,358,935,391,000 |
ps -o command shows each command on a separate line, with space separated, unquoted arguments:
$ ps -o command
COMMAND
bash
ps -o command
This can be a problem when checking whether the quoting was correct or to copy and paste a command to run it again. For example:
$ xss-lock --notifier="notify-send -- 'foo bar'" sl... |
On Linux, you can get a slightly more raw list of args to a command from /proc/$pid/cmdline for a given process id. The args are separated by the nul char. Try cat -v /proc/$pid/cmdline to see the nuls as ^@, in your case: xss-lock^@--notifier=notify-send -- 'foo bar'^@slock^@.
The following perl script can read the p... | How to show quoted command list? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.