Age | Commit message (Collapse) | Author | Files | Lines |
|
Avoid useless intermediate variables, and use if else to select the
actions.
|
|
|
|
|
|
|
|
|
|
|
|
This is the common name used for the first argument, and avoids the
variable name clash with the function argument with the same name.
This fixes a build failure on */kFreeBSD systems.
|
|
Do not tie these libraries in a single variable for start-stop-daemon,
instead move the usage to the Makefile.am.
|
|
|
|
Avoid libkvm-dev to make sure we always use the low-level sysctl(3)
interface.
|
|
|
|
This gets rid of a warning with gcc-6, that does not understand that we
never pass a NULL ‘sl’ pointer as we have checked previously if it has
slaves via alternative_has_slave().
And gets rid of unneeded calls to alternative_has_slave(), which
internally do alternative_get_slave() anyway.
|
|
Let's move all the logic concerning checking if the slave link needs to
be updated local to the function that was doing so.
|
|
This removes another dpkg-specific string from the code to make life
easier for downstreams using update-alternatives on non-dpkg based
systems.
|
|
This variable is currently set by dpkg, but other package managers or
callers might set it with a different name on other downstream projects.
Let's move the variable name to the build system so that third parties
do not have to modify the code going on to remove a dpkg-specific name.
|
|
Introduce two boolean variables to track when to log the command-line
arguments when modifying anything on the system, and another one when
modifying a single alternative to initialize and update it.
This unifies the code, and will make it easier to switch it into a
shared library in the future.
|
|
It should make the code more clear, and in many cases it avoids having
to use a temporary variable.
|
|
|
|
Commit 3db7a6eb4fd16b4cea475009bd80be3a41ada014 would always set
changegroup in the --chuid option, even if no colon is given on the
commandline.
[guillem@debian.org:
- Avoid an else from a fatal if. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Warned-by: gcc
|
|
The returned value is always allocated now, and the call sites are
respinsible for its release, so it should not have been a «const char *»
pointer, modify the call tree to make it «char *».
Warned-by: gcc
|
|
Introduced in commit 3db7a6eb4fd16b4cea475009bd80be3a41ada014.
Warned-by: coverity
|
|
Warned-by: coverity
|
|
This function and macros are unused, now that all commands have been
reimplemented fully as built-ins.
|
|
Do not execute itself with --set or --auto for each alternative to
set a selection for, just handle them in-process.
|
|
Do not execute itself with --config for each alternative to configure,
just handle them all in-process.
|
|
We will need to use functions defined further down the file, so let's
move these ones after alternative_update().
|
|
This simplifies the main() function, and will allow reusing some of
these new functions to avoid having to call itself.
|
|
We will use this name for the actual alternative remove action.
|
|
No callers have been found in Debian parsing the best version of an
alternative.
|
|
|
|
As a side effect now a missing group after ‘:’ on --chuid is a fatal
error.
Warned-by: coverity
|
|
|
|
Use clock_gettime(CLOCK_MONOTONIC) if available instead of
gettimeofday() which gets affected by abrupt system clock changes, and
might mess with the timeout calculations.
Closes: #783014
Suggested-by: Jose M Calhariz <jose.calhariz@hds.com>
|
|
Switch to use pselect() instead of select().
|
|
Cherry picked from commit eaa073bc37901a6d8c46abc9fa5e7ec5551df04b.
We should close the kvm instances after every operation, so not to leak
them, as they might exhaust the file descriptor pool, or leak into the
started process.
Closes: #779467
Based-on-patch-by: Jeff Epler <jepler@unpythonic.net>
|
|
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
This should make it more clear we are talking about the key and not
something else.
|
|
|
|
This makes it possible to correctly translate the string.
Required-by: #766311
|
|
This is the counter-option to --make-pidfile, so that programs that need
their pidfile created can use an option to remove them without needing
to do that manually.
|
|
Regression introduced in commit 29778da537e2ff1a0f032db33dde43413b7345ef.
When the user asked us to create the pidfile, but _not_ to background
ourselves, we should still create the pidfile.
This usage is somewhat dubious, as s-s-d has an option to background,
which is better in any way, as it will make sure to return error codes
in case the program cannot be started for whatever reason. But it's
still a regression.
Closes: #765110
|
|
Return NULL, and let the call sites return false themselves. This fixes
the code failing on retries when the process has disappeared.
|
|
We do not need that file, as we are not using any kvm_read(3) call,
either explicitly or implicitly. Everything is retrieved through
sysctl(2).
libkvm from FreeBSD allows to pass /dev/null as the memory file to
denote that we do not need it.
This will make s-s-d work again on jails which do not usually have
/dev/mem available.
Reported-by: Steven Chamberlain <steven@pyro.eu.org>
|
|
Create two new functions, ssd_kvm_open() and ssd_kvm_get_procs().
|
|
When running with «--stop» and only pid or ppid as matching options,
start-stop-daemon aborts with a "no match option" error.
«pid» and «ppid» are proper matching options, so they should be enough
to proceed.
Missed in commits 80de58344cb38ab085ca2c7808f4f7b3be1d2422 and
3fabf94e0b5fe1bcdea26fecee1c87e74fab98b2.
Closes: #763767
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Although this got partially corrected with the fix for the background
and pidfile creation bug, it still migth happen that the parent had a
too restrictive umask.
Closes: #760222
Reported-by: Will Conley <willconley3@gmail.com>
|
|
When using the --background option combined with --make-pidfile, the
parent process might end up exiting before the child's pidfile has been
created, which might confuse service supervising programs.
Fix the race condition by making the first parent wait for the second
one, so that it can safely create the pidfile if required.
Closes: #686420
Based-on-patch-by: Nir Soffer <nirs@hyperms.com>
|
|
We'll be needing to call the former in the latter.
|