[Eisfair_dev] init.d startproc mit system user
Marcus Roeckrath
marcus.roeckrath at gmx.de
Mo Jan 14 20:28:24 CET 2013
Hallo Jens,
Jens Kluge wrote:
>> OK, schau Dir das postgresql init Skript an ;-)
>>
> schaue ich mir gerade an... hm...
>
> heisst das muss nund doch alles im script selber abhandeln, oder hab ich
> den Hinweis falsch verstanden?
Du hast Dir mal daemon angesehen?
Für den firebird sieht der Aufruf auf dem Schulserver so aus:
case "$1" in
start)
echo -n "Starting Firebird server: "
# Speicher-Verbrauch limitieren
ulimit -d 100000
/usr/bin/daemon \
--name=firebird \
--user=$FBRunUser \
--respawn \
$FIREBIRD/bin/fbserver
echo "done"
RETVAL=$?
;;
stop|shutdown)
echo -n "Stopping Firebird server: "
/usr/bin/daemon \
--name=firebird \
--user=$FBRunUser \
--stop
echo "done"
RETVAL=0
;;
Hier die Optionen von daemon:
SYNOPSIS
usage: daemon [options] [--] [cmd arg...]
options:
-h, --help - Print a help message then exit
-V, --version - Print a version message then exit
-v, --verbose[=level] - Set the verbosity level
-d, --debug[=level] - Set the debugging level
-C, --config=path - Specify the system configuration file
-N, --noconfig - Bypass the system configuration file
-n, --name=name - Guarantee a single named instance
-X, --command=cmd - Specify the client command as an option
-P, --pidfiles=/dir - Override standard pidfile location
-F, --pidfile=/path - Override standard pidfile name and location
-u, --user=user[:[group]] - Run the client as user[:group]
-R, --chroot=path - Run the client with path as root
-D, --chdir=path - Run the client in directory path
-m, --umask=umask - Run the client with the given umask
-e, --env="var=val" - Set a client environment variable
-i, --inherit - Inherit environment variables
-U, --unsafe - Allow execution of unsafe executable
-S, --safe - Deny execution of unsafe executable
-c, --core - Allow core file generation
-r, --respawn - Respawn the client when it terminates
-a, --acceptable=# - Minimum acceptable client duration (seconds)
-A, --attempts=# - Respawn # times on error before delay
-L, --delay=# - Delay between spawn attempt bursts (seconds)
-M, --limit=# - Maximum number of spawn attempt bursts
--idiot - Idiot mode (trust root with the above)
-f, --foreground - Run the client in the foreground
-p, --pty[=noecho] - Allocate a pseudo terminal for the client
-l, --errlog=spec - Send daemon's error output to syslog or file
-b, --dbglog=spec - Send daemon's debug output to syslog or file
-o, --output=spec - Send client's output to syslog or file
-O, --stdout=spec - Send client's stdout to syslog or file
-E, --stderr=spec - Send client's stderr to syslog or file
--running - Check if a named daemon is running
--restart - Restart a named daemon client
--stop - Terminate a named daemon process
--
Gruss Marcus
Mehr Informationen über die Mailingliste Eisfair_dev