Kannel: Open Source WAP and SMS gateway  $Revision: 5037 $
start-stop-daemon.c File Reference
#include "gw-config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <signal.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/termios.h>
#include <fcntl.h>

Go to the source code of this file.

Data Structures

struct  pid_list
 
struct  sigpair
 

Macros

#define _STRUCTURED_PROC   1
 

Functions

static void * xmalloc (int size)
 
static void push (struct pid_list **list, int pid)
 
static void do_help (void)
 
static void parse_options (int argc, char *const *argv)
 
static void check (int pid)
 
static void do_pidfile (const char *name)
 
static int do_stop (void)
 
static void fatal (const char *format,...)
 
static void badusage (const char *msg)
 
static int parse_signal (const char *signal_str, int *signal_nr)
 
int main (int argc, char **argv)
 

Variables

static int testmode = 0
 
static int quietmode = 0
 
static int exitnodo = 1
 
static int start = 0
 
static int stop = 0
 
static int background = 0
 
static int mpidfile = 0
 
static int signal_nr = 15
 
static const char * signal_str = NULL
 
static int user_id = -1
 
static int runas_uid = -1
 
static int runas_gid = -1
 
static const char * userspec = NULL
 
static char * changeuser = NULL
 
static char * changegroup = NULL
 
static char * changeroot = NULL
 
static const char * cmdname = NULL
 
static char * execname = NULL
 
static char * startas = NULL
 
static const char * pidfile = NULL
 
static const char * progname = ""
 
static struct stat exec_stat
 
static struct pid_listfound = NULL
 
static struct pid_listkilled = NULL
 
static const struct sigpair siglist []
 
static int sigcount = sizeof (siglist) / sizeof (siglist[0])
 

Macro Definition Documentation

#define _STRUCTURED_PROC   1

Definition at line 126 of file start-stop-daemon.c.

Function Documentation

static void badusage ( const char *  msg)
static

Definition at line 314 of file start-stop-daemon.c.

References progname.

Referenced by parse_options().

315 {
316  if (msg)
317  fprintf(stderr, "%s: %s\n", progname, msg);
318 
319  #ifndef SunOS
320  fprintf(stderr, "Try `%s --help' for more information.\n", progname);
321  #else
322  fprintf(stderr, "Try `%s -H' for more information.\n", progname);
323  #endif
324 
325  exit(2);
326 }
static const char * progname
static XMLRPCDocument * msg
Definition: test_xmlrpc.c:86
static void check ( int  pid)
static

Definition at line 668 of file start-stop-daemon.c.

References cmdname, exec_stat, execname, push(), user_id, and userspec.

Referenced by do_pidfile().

669 {
670 #if defined(OSLinux)
671  if (execname && !pid_is_exec(pid, &exec_stat))
672  return;
673 #elif defined(OSHURD)
674  /* I will try this to see if it works */
675  if (execname && !pid_is_cmd(pid, execname))
676  return;
677 #endif
678  if (userspec && !pid_is_user(pid, user_id))
679  return;
680  if (cmdname && !pid_is_cmd(pid, cmdname))
681  return;
682  push(&found, pid);
683 }
static struct stat exec_stat
static void push(struct pid_list **list, int pid)
static struct pid_list * found
static const char * cmdname
static int user_id
static char * execname
static const char * userspec
static void do_help ( void  )
static

Definition at line 244 of file start-stop-daemon.c.

Referenced by parse_options().

245 {
246 
247 /*Print the help for systems that have getopt long*/
248 
249 #ifndef SunOS /*Solaris doesn't*/
250 
251  printf("\
252 start-stop-daemon for Debian GNU/Linux - small and fast C version written by\n\
253 Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, public domain.\n"
254 GW_VERSION "\n\
255 \n\
256 Usage:\n\
257  start-stop-daemon -S|--start options ... -- arguments ...\n\
258  start-stop-daemon -K|--stop options ...\n\
259  start-stop-daemon -H|--help\n\
260  start-stop-daemon -V|--version\n\
261 \n\
262 Options (at least one of --exec|--pidfile|--user is required):\n\
263  -x|--exec <executable> program to start/check if it is running\n\
264  -p|--pidfile <pid-file> pid file to check\n\
265  -c|--chuid <name|uid[:group|gid]>\n\
266  change to this user/group before starting process\n\
267  -u|--user <username>|<uid> stop processes owned by this user\n\
268  -n|--name <process-name> stop processes with this name\n\
269  -s|--signal <signal> signal to send (default TERM)\n\
270  -a|--startas <pathname> program to start (default is <executable>)\n\
271  -b|--background force the process to detach\n\
272  -m|--make-pidfile create the pidfile before starting\n\
273  -t|--test test mode, don't do anything\n\
274  -o|--oknodo exit status 0 (not 1) if nothing done\n\
275  -q|--quiet be more quiet\n\
276  -v|--verbose be more verbose\n\
277 \n\
278 Exit status: 0 = done 1 = nothing done (=> 0 if --oknodo) 2 = trouble\n");
279 
280 #else /* Deal with systems that don't have getopt long, like Solaris*/
281 
282  printf("\
283 start-stop-daemon for Debian GNU/Linux - small and fast C version written by\n\
284 Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, public domain.\n"
285 GW_VERSION "\n\
286 \n\
287 Usage:\n\
288  start-stop-daemon -S options ... -- arguments ...\n\
289  start-stop-daemon -K options ...\n\
290  start-stop-daemon -H\n\
291  start-stop-daemon -V\n\
292 \n\
293 Options (at least one of --exec|--pidfile|--user is required):\n\
294  -x <executable> program to start/check if it is running\n\
295  -p <pid-file> pid file to check\n\
296  -c <name|uid[:group|gid]> change to this user/group before starting process\n\
297  -u <username>|<uid> stop processes owned by this user\n\
298  -n <process-name> stop processes with this name\n\
299  -s <signal> signal to send (default TERM)\n\
300  -a <pathname> program to start (default is <executable>)\n\
301  -b force the process to detach\n\
302  -m create the pidfile before starting\n\
303  -t test mode, don't do anything\n\
304  -o exit status 0 (not 1) if nothing done\n\
305  -q be more quiet\n\
306  -v be more verbose\n\
307 \n\
308 Exit status: 0 = done 1 = nothing done (=> 0 if -o) 2 = trouble\n");
309 #endif /*No more OS ( getopt ) specific stuff this function... */
310 }
static void do_pidfile ( const char *  name)
static

Definition at line 687 of file start-stop-daemon.c.

References check().

Referenced by main().

688 {
689  FILE *f;
690  int pid;
691 
692  f = fopen(name, "r");
693  if (f) {
694  if (fscanf(f, "%d", &pid) == 1)
695  check(pid);
696  fclose(f);
697  }
698 }
char * name
Definition: smsc_cimd2.c:212
static void check(int pid)
static int do_stop ( void  )
static

Definition at line 761 of file start-stop-daemon.c.

References cmdname, execname, exitnodo, fatal(), pid_list::next, pid_list::pid, pidfile, progname, push(), quietmode, signal_nr, testmode, and userspec.

Referenced by main().

762 {
763  char what[1024];
764  struct pid_list *p;
765  int retval = 0;
766 
767  if (cmdname)
768  strcpy(what, cmdname);
769  else if (execname)
770  strcpy(what, execname);
771  else if (pidfile)
772  sprintf(what, "process in pidfile `%s'", pidfile);
773  else if (userspec)
774  sprintf(what, "process(es) owned by `%s'", userspec);
775  else
776  fatal("internal error, please report");
777 
778  if (!found) {
779  if (quietmode <= 0)
780  printf("No %s found running; none killed.\n", what);
781  exit(exitnodo);
782  }
783  for (p = found; p; p = p->next) {
784  if (testmode)
785  printf("Would send signal %d to %d.\n",
786  signal_nr, p->pid);
787  else if (kill(p->pid, signal_nr) == 0)
788  push(&killed, p->pid);
789  else {
790  printf("%s: warning: failed to kill %d: %s\n",
791  progname, p->pid, strerror(errno));
792  retval += exitnodo;
793  }
794  }
795  if (quietmode < 0 && killed) {
796  printf("Stopped %s (pid", what);
797  for (p = killed; p; p = p->next)
798  printf(" %d", p->pid);
799  printf(").\n");
800  }
801  return retval;
802 }
static const char * progname
static const char * pidfile
static void push(struct pid_list **list, int pid)
static struct pid_list * found
static struct pid_list * killed
static int exitnodo
static int quietmode
struct pid_list * next
static const char * cmdname
static int testmode
static char * execname
static const char * userspec
static int signal_nr
static void fatal(const char *format,...)
static void fatal ( const char *  format,
  ... 
)
static

Definition at line 206 of file start-stop-daemon.c.

References progname.

Referenced by do_stop(), main(), and xmalloc().

207 {
208  va_list arglist;
209 
210  fprintf(stderr, "%s: ", progname);
211  va_start(arglist, format);
212  vfprintf(stderr, format, arglist);
213  va_end(arglist);
214  putc('\n', stderr);
215  exit(2);
216 }
static const char * progname
int main ( int  argc,
char **  argv 
)

Definition at line 806 of file start-stop-daemon.c.

References background, changegroup, changeroot, changeuser, do_pidfile(), do_stop(), exec_stat, execname, exitnodo, fatal(), mpidfile, optind, parse_options(), pidfile, progname, quietmode, runas_gid, runas_uid, startas, stop, testmode, user_id, and userspec.

807 {
808  progname = argv[0];
809 
810  parse_options(argc, argv);
811  argc -= optind;
812  argv += optind;
813 
814  if (execname && stat(execname, &exec_stat))
815  fatal("stat %s: %s", execname, strerror(errno));
816 
817  if (userspec && sscanf(userspec, "%d", &user_id) != 1) {
818  struct passwd *pw;
819 
820  pw = getpwnam(userspec);
821  if (!pw)
822  fatal("user `%s' not found\n", userspec);
823 
824  user_id = pw->pw_uid;
825  }
826 
827  if (changegroup && sscanf(changegroup, "%d", &runas_gid) != 1) {
828  struct group *gr = getgrnam(changegroup);
829  if (!gr)
830  fatal("group `%s' not found\n", changegroup);
831  runas_gid = gr->gr_gid;
832  }
833  if (changeuser && sscanf(changeuser, "%d", &runas_uid) != 1) {
834  struct passwd *pw = getpwnam(changeuser);
835  if (!pw)
836  fatal("user `%s' not found\n", changeuser);
837  runas_uid = pw->pw_uid;
838  if (changegroup == NULL) { /* pass the default group of this user */
839  changegroup = ""; /* just empty */
840  runas_gid = pw->pw_gid;
841  }
842  }
843 
844  if (pidfile)
846  else
847  do_procinit();
848 
849  if (stop) {
850  int i = do_stop();
851  if (i) {
852  if (quietmode <= 0)
853  printf("%d pids were not killed\n", i);
854  exit(1);
855  }
856  exit(0);
857  }
858 
859  if (found) {
860  if (quietmode <= 0)
861  printf("%s already running.\n", execname);
862  exit(exitnodo);
863  }
864  if (testmode) {
865  printf("Would start %s ", startas);
866  while (argc-- > 0)
867  printf("%s ", *argv++);
868  if (changeuser != NULL) {
869  printf(" (as user %s[%d]", changeuser, runas_uid);
870  if (changegroup != NULL)
871  printf(", and group %s[%d])", changegroup, runas_gid);
872  else
873  printf(")");
874  }
875  if (changeroot != NULL)
876  printf(" in directory %s", changeroot);
877  printf(".\n");
878  exit(0);
879  }
880  if (quietmode < 0)
881  printf("Starting %s...\n", startas);
882  *--argv = startas;
883  if (changeroot != NULL) {
884  if (chdir(changeroot) < 0)
885  fatal("Unable to chdir() to %s", changeroot);
886  if (chroot(changeroot) < 0)
887  fatal("Unable to chroot() to %s", changeroot);
888  }
889  if (changeuser != NULL) {
890  if (setgid(runas_gid))
891  fatal("Unable to set gid to %d", runas_gid);
892  if (initgroups(changeuser, runas_gid))
893  fatal("Unable to set initgroups() with gid %d", runas_gid);
894  if (setuid(runas_uid))
895  fatal("Unable to set uid to %s", changeuser);
896  }
897 
898  if (background) { /* ok, we need to detach this process */
899  int i, fd;
900  if (quietmode < 0)
901  printf("Detatching to start %s...", startas);
902  i = fork();
903  if (i<0) {
904  fatal("Unable to fork.\n");
905  }
906  if (i) { /* parent */
907  if (quietmode < 0)
908  printf("done.\n");
909  exit(0);
910  }
911  /* child continues here */
912  /* now close all extra fds */
913  for (i=getdtablesize()-1; i>=0; --i) close(i);
914  /* change tty */
915  fd = open("/dev/tty", O_RDWR);
916  ioctl(fd, TIOCNOTTY, 0);
917  close(fd);
918  chdir("/");
919  umask(022); /* set a default for dumb programs */
920 #ifdef DARWIN
921  setpgrp(); /* set the process group */
922 #else
923 #ifndef FreeBSD
924  setpgrp(); /* set the process group */
925 #else
926  setpgrp(0, runas_gid); /* set the process group */
927 #endif
928 #endif
929 
930  fd=open("/dev/null", O_RDWR); /* stdin */
931  dup(fd); /* stdout */
932  dup(fd); /* stderr */
933  }
934  if (mpidfile && pidfile != NULL) { /* user wants _us_ to make the pidfile :) */
935  FILE *pidf = fopen(pidfile, "w");
936  pid_t pidt = getpid();
937  if (pidf == NULL)
938  fatal("Unable to open pidfile `%s' for writing: %s", pidfile,
939  strerror(errno));
940  fprintf(pidf, "%d\n", (int)pidt);
941  fclose(pidf);
942  }
943  execv(startas, argv);
944  fatal("Unable to start %s: %s", startas, strerror(errno));
945 }
static char * startas
static char * changegroup
static struct stat exec_stat
static const char * progname
static const char * pidfile
int optind
Definition: attgetopt.c:80
static void do_pidfile(const char *name)
static char * changeuser
static struct pid_list * found
static void parse_options(int argc, char *const *argv)
static int mpidfile
static int runas_uid
static int exitnodo
static int quietmode
static int stop
static int runas_gid
static int do_stop(void)
static char * changeroot
static int background
static int testmode
static int user_id
static char * execname
static const char * userspec
static void fatal(const char *format,...)
static void parse_options ( int  argc,
char *const *  argv 
)
static

Definition at line 369 of file start-stop-daemon.c.

References background, badusage(), changegroup, changeroot, changeuser, cmdname, do_help(), execname, exitnodo, getopt(), mpidfile, optarg, option, parse_signal(), pidfile, quietmode, signal_nr, signal_str, start, startas, stop, strdup, testmode, and userspec.

Referenced by main().

370 {
371 
372 #if HAVE_GETOPT_LONG
373  static struct option longopts[] = {
374  { "help", 0, NULL, 'H'},
375  { "stop", 0, NULL, 'K'},
376  { "start", 0, NULL, 'S'},
377  { "version", 0, NULL, 'V'},
378  { "startas", 1, NULL, 'a'},
379  { "name", 1, NULL, 'n'},
380  { "oknodo", 0, NULL, 'o'},
381  { "pidfile", 1, NULL, 'p'},
382  { "quiet", 0, NULL, 'q'},
383  { "signal", 1, NULL, 's'},
384  { "test", 0, NULL, 't'},
385  { "user", 1, NULL, 'u'},
386  { "chroot", 1, NULL, 'r'},
387  { "verbose", 0, NULL, 'v'},
388  { "exec", 1, NULL, 'x'},
389  { "chuid", 1, NULL, 'c'},
390  { "background", 0, NULL, 'b'},
391  { "make-pidfile", 0, NULL, 'm'},
392  { NULL, 0, NULL, 0}
393  };
394 #endif
395  int c;
396 
397  for (;;) {
398 #if HAVE_GETOPT_LONG
399  c = getopt_long(argc, argv, "HKSVa:n:op:qr:s:tu:vx:c:bm",
400  longopts, (int *) 0);
401 #else
402  c = getopt(argc, argv, "HKSVa:n:op:qr:s:tu:vx:c:bm");
403 #endif
404  if (c == -1)
405  break;
406  switch (c) {
407  case 'H': /* --help */
408  do_help();
409  exit(0);
410  case 'K': /* --stop */
411  stop = 1;
412  break;
413  case 'S': /* --start */
414  start = 1;
415  break;
416  case 'V': /* --version */
417  printf("start-stop-daemon " GW_VERSION "\n");
418  exit(0);
419  case 'a': /* --startas <pathname> */
420  startas = optarg;
421  break;
422  case 'n': /* --name <process-name> */
423  cmdname = optarg;
424  break;
425  case 'o': /* --oknodo */
426  exitnodo = 0;
427  break;
428  case 'p': /* --pidfile <pid-file> */
429  pidfile = optarg;
430  break;
431  case 'q': /* --quiet */
432  quietmode = 1;
433  break;
434  case 's': /* --signal <signal> */
435  signal_str = optarg;
436  break;
437  case 't': /* --test */
438  testmode = 1;
439  break;
440  case 'u': /* --user <username>|<uid> */
441  userspec = optarg;
442  break;
443  case 'v': /* --verbose */
444  quietmode = -1;
445  break;
446  case 'x': /* --exec <executable> */
447  execname = optarg;
448  break;
449  case 'c': /* --chuid <username>|<uid> */
450  /* we copy the string just in case we need the
451  * argument later. */
453  changeuser = strtok(changeuser, ":");
454  changegroup = strtok(NULL, ":");
455  break;
456  case 'r': /* --chroot /new/root */
457  changeroot = optarg;
458  break;
459  case 'b': /* --background */
460  background = 1;
461  break;
462  case 'm': /* --make-pidfile */
463  mpidfile = 1;
464  break;
465  default:
466  badusage(NULL); /* message printed by getopt */
467  }
468  }
469 
470  if (signal_str != NULL) {
471  if (sscanf (signal_str, "%d", &signal_nr) != 1) {
472  if (parse_signal (signal_str, &signal_nr) != 0) {
473  badusage ("--signal takes a numeric argument or name of signal (KILL, INTR, ...)");
474  }
475  }
476  }
477 
478  if (start == stop)
479  #ifndef SunOS
480  badusage("need one of --start or --stop");
481  #else
482  badusage("need one of -S (start) or -K (stop)");
483  #endif
484 
485  if (!execname && !pidfile && !userspec)
486  badusage("need at least one of --exec, --pidfile or --user");
487 
488  if (!startas)
489  startas = execname;
490 
491  if (start && !startas)
492  badusage("--start needs --exec or --startas");
493 
494  if (mpidfile && pidfile == NULL)
495  badusage("--make-pidfile is only relevant with --pidfile");
496 
497  if (background && !start)
498  badusage("--background is only relevant with --start");
499 
500 }
static char * startas
static char * changegroup
static const char * signal_str
static const char * pidfile
static char * changeuser
static void badusage(const char *msg)
static int mpidfile
int getopt(int argc, char **argv, char *opts)
Definition: attgetopt.c:84
static int exitnodo
static int quietmode
static int stop
static void do_help(void)
static const char * cmdname
unsigned char * option
Definition: test_cimd2.c:1000
#define strdup(p)
Definition: gwmem.h:195
static char * changeroot
char * optarg
Definition: attgetopt.c:82
static int background
static int testmode
static int parse_signal(const char *signal_str, int *signal_nr)
static char * execname
static const char * userspec
static int signal_nr
static int start
static int parse_signal ( const char *  signal_str,
int *  signal_nr 
)
static

Definition at line 356 of file start-stop-daemon.c.

References name, sigcount, and sigpair::signal.

Referenced by parse_options().

357 {
358  int i;
359  for (i = 0; i < sigcount; i++) {
360  if (strcmp (signal_str, siglist[i].name) == 0) {
361  *signal_nr = siglist[i].signal;
362  return 0;
363  }
364  }
365  return -1;
366 }
static const char * signal_str
static int sigcount
static const struct sigpair siglist[]
char * name
Definition: smsc_cimd2.c:212
static int signal_nr
static void push ( struct pid_list **  list,
int  pid 
)
static

Definition at line 232 of file start-stop-daemon.c.

References pid_list::next, pid_list::pid, and xmalloc().

Referenced by check(), and do_stop().

233 {
234  struct pid_list *p;
235 
236  p = xmalloc(sizeof(*p));
237  p->next = *list;
238  p->pid = pid;
239  *list = p;
240 }
struct pid_list * next
static void * xmalloc(int size)
static void * xmalloc ( int  size)
static

Definition at line 220 of file start-stop-daemon.c.

References fatal(), and malloc.

Referenced by push().

221 {
222  void *ptr;
223 
224  ptr = malloc(size);
225  if (ptr)
226  return ptr;
227  fatal("malloc(%d) failed", size);
228 }
int size
Definition: wsasm.c:84
#define malloc(n)
Definition: gwmem.h:191
static void fatal(const char *format,...)

Variable Documentation

int background = 0
static

Definition at line 144 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

char* changegroup = NULL
static

Definition at line 153 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

char* changeroot = NULL
static

Definition at line 154 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

char* changeuser = NULL
static

Definition at line 152 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

const char* cmdname = NULL
static

Definition at line 155 of file start-stop-daemon.c.

Referenced by check(), do_stop(), and parse_options().

struct stat exec_stat
static

Definition at line 161 of file start-stop-daemon.c.

Referenced by check(), and main().

char* execname = NULL
static

Definition at line 156 of file start-stop-daemon.c.

Referenced by check(), do_stop(), main(), and parse_options().

int exitnodo = 1
static

Definition at line 141 of file start-stop-daemon.c.

Referenced by do_stop(), main(), and parse_options().

struct pid_list* killed = NULL
static

Definition at line 174 of file start-stop-daemon.c.

int mpidfile = 0
static

Definition at line 145 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

const char* pidfile = NULL
static

Definition at line 158 of file start-stop-daemon.c.

Referenced by do_stop(), main(), and parse_options().

const char* progname = ""
static

Definition at line 159 of file start-stop-daemon.c.

Referenced by badusage(), do_stop(), fatal(), and main().

int quietmode = 0
static

Definition at line 140 of file start-stop-daemon.c.

Referenced by do_stop(), main(), and parse_options().

int runas_gid = -1
static

Definition at line 150 of file start-stop-daemon.c.

Referenced by main().

int runas_uid = -1
static

Definition at line 149 of file start-stop-daemon.c.

Referenced by main().

int sigcount = sizeof (siglist) / sizeof (siglist[0])
static

Definition at line 354 of file start-stop-daemon.c.

Referenced by parse_signal().

const struct sigpair siglist[]
static
Initial value:
= {
{ "ABRT", SIGABRT },
{ "ALRM", SIGALRM },
{ "FPE", SIGFPE },
{ "HUP", SIGHUP },
{ "ILL", SIGILL },
{ "INT", SIGINT },
{ "KILL", SIGKILL },
{ "PIPE", SIGPIPE },
{ "QUIT", SIGQUIT },
{ "SEGV", SIGSEGV },
{ "TERM", SIGTERM },
{ "USR1", SIGUSR1 },
{ "USR2", SIGUSR2 },
{ "CHLD", SIGCHLD },
{ "CONT", SIGCONT },
{ "STOP", SIGSTOP },
{ "TSTP", SIGTSTP },
{ "TTIN", SIGTTIN },
{ "TTOU", SIGTTOU }
}

Definition at line 333 of file start-stop-daemon.c.

int signal_nr = 15
static

Definition at line 146 of file start-stop-daemon.c.

Referenced by do_stop(), and parse_options().

const char* signal_str = NULL
static

Definition at line 147 of file start-stop-daemon.c.

Referenced by parse_options().

char* startas = NULL
static

Definition at line 157 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

int stop = 0
static

Definition at line 143 of file start-stop-daemon.c.

Referenced by main(), and parse_options().

int testmode = 0
static

Definition at line 139 of file start-stop-daemon.c.

Referenced by do_stop(), main(), and parse_options().

int user_id = -1
static

Definition at line 148 of file start-stop-daemon.c.

Referenced by check(), and main().

const char* userspec = NULL
static

Definition at line 151 of file start-stop-daemon.c.

Referenced by check(), do_stop(), main(), and parse_options().

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.