summary refs log tree commit diff
path: root/src/chpst.c
Commit message (Collapse)AuthorAgeFilesLines
* chpst: add -C to change working directoryAndrew J. Hesford2024-09-271-2/+7
|
* fix compilation warning(s): -WunsequencedZ. Liu2024-09-261-1/+2
| | | | | | | | | | | | | | found by using clang 18 with CFLAGS: -Wall link of debian's patches is: https://salsa.debian.org/debian/runit/-/tree/master/debian/patches 0016-fix-warning-for-undefined-operation-on-sequence-poin.patch chpst.c:312:33: warning: unsequenced modification and access to 'subgetoptarg' [-Wunsequenced] 312 | if (optarg[scan_ulong(++optarg, &ul)]) usage(); nicelvl =ul; | ~~~~~~ ^ gcc report: chpst.c:312:33: warning: operation on 'subgetoptarg' may be undefined [-Wsequence-point]
* add/update doc & man page of chpst and runsvZ. Liu2024-09-251-1/+1
| | | | | | | | | | | | | | | 1. fix error in runsv for log/finish: Log ./finish script is not actually invoked. It is not clear, whether this limitation is worth lifting. 2. add options -t and -V to chpst man page; ignore -r since it's obsolete. 3. clarify in runsv.8 manpage how signal override works with control/dx copied from debian's patch: 0009-fix-error-in-manpage.patch 0027-Clarify-runsv-8-control-dx.patch 0027-Add-missing-options-to-chpst-manpage.patch links of debian's patches is: https://salsa.debian.org/debian/runit/-/tree/master/debian/patches
* no longer check for shortsetgroups, setgroups is used directlyGerrit Pape2024-09-251-2/+1
| | | | Thx Leah Neukirchen.
* fix compilation warning(s): -Wincompatible-pointer-types-discards-qualifiersZ. Liu2024-09-251-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | found by using clang 18 with CFLAGS: -Wall since gcc 14, certain warnings (including this one, gcc report as -Wincompatible-pointer-types) are now errors, see https://gcc.gnu.org/gcc-14/porting_to.html link of debian's patches is: https://salsa.debian.org/debian/runit/-/tree/master/debian/patches 0014-fix-implicit-declarations-incompatible-types-argv-ty.patch pathexec_run.c: warning: passing 'const char *const *' to parameter of type 'char *const *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] 19 | execve(file,argv,envp); | ^~~~ ^~~~ 36 | execve(tmp.s,argv,envp); | ^~~~ ^~~~ pathexec_env.c:67:21: warning: passing 'const char *const *' to parameter of type 'char *const *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] 67 | pathexec_run(file,argv,e); | ^~~~ pathexec_env.c:67:26: warning: passing 'const char **' to parameter of type 'char *const *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] 67 | pathexec_run(file,argv,e); | ^ runsvdir.c:74:25: warning: passing 'const char *[3]' to parameter of type 'char *const *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] 74 | pathexec_run(*prog, prog, (const char* const*)environ); | ^~~~ runsvdir.c:74:31: warning: passing 'const char *const *' to parameter of type 'char *const *' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] 74 | pathexec_run(*prog, prog, (const char* const*)environ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
* fix compilation error(s): call to undeclared function for C99 and laterZ. Liu2024-09-251-0/+1
| | | | | | | | | | found by using clang 18 with CFLAGS: -Wall error: call to undeclared function '...'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] chpst.c: setgroups pathexec_run.c: execve prot.c: setgroups, setgid, setuid seek_set.c: lseek
* * chpst.c, svwaitdown.c, svwaitup.c: fix checks for return value ofGerrit Pape2009-09-241-1/+1
| | | | open_* functions (thx David Reiss).
* * pathexec_env.c, pathexec.h: add function pathexec_env_run().Gerrit Pape2009-09-241-5/+10
| | | | | * chpst.c, man/chpst.8: new option -b argv0: run prog with different 0th argument.
* chpst.c: add explicit braces to avoid ambiguous 'else'.Gerrit Pape2007-06-261-2/+4
|
* chpst.c, uidgid.c: improve error reporting if getpwnam() or getgrnam() failsGerrit Pape2007-04-171-15/+15
| | | | ...cleanup.
* * chpst.c, uidgid.c, uidgid.h: support numerical uid gid throughGerrit Pape2006-11-021-8/+18
| | | | | | | | chpst -[u|U] :uid:gid... * man/chpst.8: adapt; clarify that users and groups are looked up in /etc/passwd and /etc/group only. * sv.c: properly wait for a service to be restarted on 'restart'; support checks through -v for pause, cont, kill.
* * chpst: new option -d, limit data segment per process; don't use nestedGerrit Pape2006-03-041-58/+62
| | | | functions.
* * chpst.c: adjust nice value and set limits before dropping permissions.Gerrit Pape2006-01-021-6/+5
| | | | | | | * sv.c: new additional command 'check'; with -v check for CONT through ./check if service is up. * man/sv.8: adapt. 1.3.3.
* * doc/runscripts.html: typo; openssh needs absolute path (thx Kevin Berry);Gerrit Pape2005-08-231-2/+3
| | | | | | | | | exec into dhcpcd. * uidgid.c, uidgid.h, chpst.c: support colon-separated list of groups. * sv.c: utilize optional ./check script in service directory to check for availablity of service. * runsv.c: wait_pid() might be interupted. * man/chpst.8, man/sv.8: adapt.
* * chpst.c: fix pointer types.Gerrit Pape2005-07-231-12/+16
|
* * chpst.c: typo.Gerrit Pape2005-01-101-1/+1
| | | | | | | | | * svwaitdown.c: minimum timeout is 1 second; service directories no longer must start with /. * svwaitup.c: minimum uptime of services is 1 second; service directories no longer must start with /; print number of seconds a service is up if verbose. * man/svwaitdown.8, man/svwaitup.8: adapt.
* * svlogd.c: new config option t timeout; config options e and E select andGerrit Pape2004-11-061-10/+27
| | | | | | | | | | | deselect lines for stderr respectively; new config option N. * man/svlogd.8: adapt. * runsv.c: on commands down and exit send CONT after TERM. * man/runsv.8: adapt. * etc/2: use -P option to runsvdir. * src/svlogd.check: end check for t config option. * chpst.c: new option -n: adjust nice level. * man/chpst.8: adapt.
* chdir before chroot.Gerrit Pape2004-04-301-1/+4
|
* chpst: support -/ chroot.Gerrit Pape2004-04-271-2/+6
|
* * chpst.c: -e dir: silently ignore directories, print warning if verbose.Gerrit Pape2004-03-021-3/+11
|
* * uidgid.c, uidgid.h: new; get uid/gid by name.Gerrit Pape2003-08-051-0/+418
* chpst: new; run program with a changed process state (includes envdir, envuidgid, pgrphack, setlock, setuidgid, softlimit functionality).