FreeBSD Bugzilla – Attachment 163841 Details for
Bug 205016
The new command line option to set the daemon(8) process title
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
daemon.patch (text/plain), 1.76 KB, created by
Yuri Victorovich
on 2015-12-04 14:00:27 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2015-12-04 14:00:27 UTC
Size:
1.76 KB
patch
obsolete
>Index: usr.sbin/daemon/daemon.8 >=================================================================== >--- usr.sbin/daemon/daemon.8 (revision 290925) >+++ usr.sbin/daemon/daemon.8 (working copy) >@@ -37,6 +37,7 @@ > .Op Fl cfr > .Op Fl p Ar child_pidfile > .Op Fl P Ar supervisor_pidfile >+.Op Fl t Ar title > .Op Fl u Ar user > .Ar command arguments ... > .Sh DESCRIPTION >@@ -94,6 +95,8 @@ > option is used or not. > .It Fl r > Supervise and restart the program if it has been terminated. >+.It Fl t Ar title >+Process title for the daemon to make it easily identifiable. > .It Fl u Ar user > Login name of the user to execute the program under. > Requires adequate superuser privileges. >Index: usr.sbin/daemon/daemon.c >=================================================================== >--- usr.sbin/daemon/daemon.c (revision 290925) >+++ usr.sbin/daemon/daemon.c (working copy) >@@ -56,13 +56,13 @@ > struct pidfh *ppfh, *pfh; > sigset_t mask, oldmask; > int ch, nochdir, noclose, restart, serrno; >- const char *pidfile, *ppidfile, *user; >+ const char *pidfile, *ppidfile, *ptitle, *user; > pid_t otherpid, pid; > > nochdir = noclose = 1; > restart = 0; >- ppidfile = pidfile = user = NULL; >- while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) { >+ ppidfile = pidfile = ptitle = user = NULL; >+ while ((ch = getopt(argc, argv, "cfp:P:rt:u:")) != -1) { > switch (ch) { > case 'c': > nochdir = 0; >@@ -79,6 +79,9 @@ > case 'r': > restart = 1; > break; >+ case 't': >+ ptitle = optarg; >+ break; > case 'u': > user = optarg; > break; >@@ -204,7 +207,11 @@ > err(1, "%s", argv[0]); > } > >- setproctitle("%s[%d]", argv[0], pid); >+ if (ptitle) { >+ setproctitle("%s", ptitle); >+ } else { >+ setproctitle("%s[%d]", argv[0], pid); >+ } > if (wait_child(pid, &mask) == 0 && restart) { > sleep(1); > goto restart;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205016
: 163841