add more variables for start-stop-daemon and supervise-daemon options
Add the following variables to expose more arguments that can be passed to start-stop-daemon or supervise-daemon: - directory will be passed to --chdir - error_log will be passed to --stderr - output_log will be passed to --stdout - umask will be passed to umask This is for #184.
This commit is contained in:
parent
c84ebb94d1
commit
ddbdb69658
@ -157,6 +157,24 @@ use this to change the user id before
|
|||||||
or
|
or
|
||||||
.Xr supervise-daemon 8
|
.Xr supervise-daemon 8
|
||||||
launches the daemon
|
launches the daemon
|
||||||
|
.It Ar output_log
|
||||||
|
This is the path to a file or named pipe where the standard output from
|
||||||
|
the service will be redirected. If you are starting this service with
|
||||||
|
.Xr start-stop-daemon 8 ,
|
||||||
|
, you must set
|
||||||
|
.Pa command_background
|
||||||
|
to true. Keep in mind that this path will be inside the chroot if the
|
||||||
|
.Pa chroot
|
||||||
|
variable is set.
|
||||||
|
.It Ar error_log
|
||||||
|
The same thing as
|
||||||
|
.Pa output_log
|
||||||
|
but for the standard error output.
|
||||||
|
.It Ar directory
|
||||||
|
.Xr start-stop-daemon 8
|
||||||
|
and
|
||||||
|
.Xr supervise-daemon 8
|
||||||
|
will chdir to this directory before starting the daemon.
|
||||||
.It Ar chroot
|
.It Ar chroot
|
||||||
.Xr start-stop-daemon 8
|
.Xr start-stop-daemon 8
|
||||||
and
|
and
|
||||||
@ -201,6 +219,8 @@ used along with in_background_fake to support re-entrant services.
|
|||||||
.It Ar in_background_fake
|
.It Ar in_background_fake
|
||||||
Space separated list of commands which should always succeed when
|
Space separated list of commands which should always succeed when
|
||||||
in_background is yes.
|
in_background is yes.
|
||||||
|
.It Ar umask
|
||||||
|
Set the umask of the daemon.
|
||||||
.Pp
|
.Pp
|
||||||
Keep in mind that eval is used to process chroot, command, command_args_*,
|
Keep in mind that eval is used to process chroot, command, command_args_*,
|
||||||
command_user, pidfile and procname. This may affect how they are
|
command_user, pidfile and procname. This may affect how they are
|
||||||
|
@ -44,9 +44,13 @@ ssd_start()
|
|||||||
eval start-stop-daemon --start \
|
eval start-stop-daemon --start \
|
||||||
--exec $command \
|
--exec $command \
|
||||||
${chroot:+--chroot} $chroot \
|
${chroot:+--chroot} $chroot \
|
||||||
|
${directory:+--chdir} $directory \
|
||||||
|
${output_log+--stdout} $output_log \
|
||||||
|
${error_log+--stderr} $error_log \
|
||||||
${procname:+--name} $procname \
|
${procname:+--name} $procname \
|
||||||
${pidfile:+--pidfile} $pidfile \
|
${pidfile:+--pidfile} $pidfile \
|
||||||
${command_user+--user} $command_user \
|
${command_user+--user} $command_user \
|
||||||
|
${umask+--umask} $umask \
|
||||||
$_background $start_stop_daemon_args \
|
$_background $start_stop_daemon_args \
|
||||||
-- $command_args $command_args_background
|
-- $command_args $command_args_background
|
||||||
if eend $? "Failed to start ${name:-$RC_SVCNAME}"; then
|
if eend $? "Failed to start ${name:-$RC_SVCNAME}"; then
|
||||||
|
@ -24,12 +24,16 @@ supervise_start()
|
|||||||
# to work properly.
|
# to work properly.
|
||||||
eval supervise-daemon "${RC_SVCNAME}" --start \
|
eval supervise-daemon "${RC_SVCNAME}" --start \
|
||||||
${retry:+--retry} $retry \
|
${retry:+--retry} $retry \
|
||||||
|
${directory:+--chdir} $directory \
|
||||||
${chroot:+--chroot} $chroot \
|
${chroot:+--chroot} $chroot \
|
||||||
|
${output_log+--stdout} ${output_log} \
|
||||||
|
${error_log+--stderr} $error_log \
|
||||||
${pidfile:+--pidfile} $pidfile \
|
${pidfile:+--pidfile} $pidfile \
|
||||||
${respawn_delay:+--respawn-delay} $respawn_delay \
|
${respawn_delay:+--respawn-delay} $respawn_delay \
|
||||||
${respawn_max:+--respawn-max} $respawn_max \
|
${respawn_max:+--respawn-max} $respawn_max \
|
||||||
${respawn_period:+--respawn-period} $respawn_period \
|
${respawn_period:+--respawn-period} $respawn_period \
|
||||||
${command_user+--user} $command_user \
|
${command_user+--user} $command_user \
|
||||||
|
${umask+--umask} $umask \
|
||||||
$supervise_daemon_args \
|
$supervise_daemon_args \
|
||||||
$command \
|
$command \
|
||||||
-- $command_args $command_args_foreground
|
-- $command_args $command_args_foreground
|
||||||
|
Loading…
Reference in New Issue
Block a user