From 29c4521100d47a589c89ef3145db61f9e4a00cf9 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Sun, 20 Apr 2008 20:47:39 +0000 Subject: * change default directory for services from /var/service/ to /service/. --- doc/benefits.html | 2 +- doc/faq.html | 8 ++++---- doc/replaceinit.html | 8 ++++---- doc/runlevels.html | 14 +++++++------- doc/runscripts.html | 2 +- doc/runsv.8.html | 4 ++-- doc/runsvchdir.8.html | 4 ++-- doc/sv.8.html | 4 ++-- doc/useinit.html | 4 ++-- doc/utmpset.8.html | 2 +- etc/2 | 2 +- etc/debian/3 | 4 ++-- etc/freebsd/3 | 4 ++-- etc/macosx/StartupItems/runit | 4 ++-- etc/macosx/org.smarden.runit.plist | 2 +- etc/openbsd/3 | 4 ++-- man/runsv.8 | 4 ++-- man/runsvchdir.8 | 4 ++-- man/sv.8 | 4 ++-- man/utmpset.8 | 2 +- package/CHANGES | 1 + src/sv.c | 2 +- 22 files changed, 45 insertions(+), 44 deletions(-) diff --git a/doc/benefits.html b/doc/benefits.html index 57f0d94..193e734 100644 --- a/doc/benefits.html +++ b/doc/benefits.html @@ -149,7 +149,7 @@ sysvinit. Stage 2 is packaging friendly: all a software package that provides a service needs to do is to include a service directory in the package, and to provide a symbolic link -to this directory in /var/service/. +to this directory in /service/. The service will be started within five seconds, and automatically at boot time. The package's install and update scripts can use the reliable control diff --git a/doc/faq.html b/doc/faq.html index 7fdf734..a2eae27 100644 --- a/doc/faq.html +++ b/doc/faq.html @@ -216,12 +216,12 @@ How do I tell runit about the new service directory, so that it picks up and runs the service by default?

Answer: -Create a symbolic link in /var/service/ pointing to the service +Create a symbolic link in /service/ pointing to the service directory, runit will pick up the service within the next five seconds, and automatically start it on system boot. E.g.:

- # ln -s /etc/sv/getty-2 /var/service/
+ # ln -s /etc/sv/getty-2 /service/
 

@@ -283,13 +283,13 @@ supervision. How do I tell runit?

Answer: -Remove the symbolic link in /var/service/ pointing to the service +Remove the symbolic link in /service/ pointing to the service directory, runit recognizes the removed service within the next five seconds, then stops the service, the optional log service, and finally the supervisor process. E.g.:

- # rm /var/service/getty-2
+ # rm /service/getty-2
 

diff --git a/doc/replaceinit.html b/doc/replaceinit.html index b154dd3..010d064 100644 --- a/doc/replaceinit.html +++ b/doc/replaceinit.html @@ -52,8 +52,8 @@ running any getty (edit /etc/inittab and kill -HUP 1 if needed), and tell runsvdir about the getty-5 service:
- # mkdir -p /var/service
- # ln -s /etc/sv/getty-5 /var/service/
+ # mkdir -p /service
+ # ln -s /etc/sv/getty-5 /service/
 
Start runit's stage 2 for testing:
@@ -177,8 +177,8 @@ FreeBSD 4.4:
 and tell runsvdir about the getty-5
 service:
 
- # mkdir -p /var/service
- # ln -s /etc/sv/getty-5 /var/service/
+ # mkdir -p /service
+ # ln -s /etc/sv/getty-5 /service/
 
Start runit's stage 2 for testing:
diff --git a/doc/runlevels.html b/doc/runlevels.html
index b2a5604..c0e49c3 100644
--- a/doc/runlevels.html
+++ b/doc/runlevels.html
@@ -25,17 +25,17 @@ Create the following directories and symbolic links:
  # ln -s /etc/sv/getty-5 /etc/runit/runsvdir/single/
  # ln -s default /etc/runit/runsvdir/current
 
-Copy the contents of /var/service/ to -/etc/runit/runsvdir/current/ and replace /var/service/ +Copy the contents of /service/ to +/etc/runit/runsvdir/current/ and replace /service/ with a symbolic link:
- # cp -pR /var/service/* /etc/runit/runsvdir/current/
- # mv -f /var/service /var/service.old && \
-     ln -s /etc/runit/runsvdir/current /var/service
+ # cp -pR /service/* /etc/runit/runsvdir/current/
+ # mv -f /service /service.old && \
+     ln -s /etc/runit/runsvdir/current /service
 
You have now created two runlevels: default and single. The current runlevel is default. -It is safe to remove /var/service.old/ if you don't need it anymore. +It is safe to remove /service.old/ if you don't need it anymore.

Finally edit /etc/runit/2 to set the default runlevel when stage 2 starts: @@ -47,7 +47,7 @@ stage 2 starts: runsvchdir default >/dev/null exec env - PATH=$PATH \ - runsvdir /var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' + runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'


Switching runlevels

diff --git a/doc/runscripts.html b/doc/runscripts.html index aa275ce..f832b63 100644 --- a/doc/runscripts.html +++ b/doc/runscripts.html @@ -390,7 +390,7 @@ to be set up.
  #!/bin/sh
  exec 2>&1
- sv start /var/service/portmap || exit 1
+ sv start /service/portmap || exit 1
  exec famd -T 0 -f
 

diff --git a/doc/runsv.8.html b/doc/runsv.8.html index 91646e8..3f430f1 100644 --- a/doc/runsv.8.html +++ b/doc/runsv.8.html @@ -108,9 +108,9 @@ command is ignored if it is given to service/log/supervise/control.

Example: to send a TERM signal to the socklog-unix service, either do # sv term -/var/service/socklog-unix
+/service/socklog-unix
or
- # printf t >/var/service/socklog-unix/supervise/control
+ # printf t >/service/socklog-unix/supervise/control

printf(1) usually blocks if no runsv process is running in the service directory. diff --git a/doc/runsvchdir.8.html b/doc/runsvchdir.8.html index d9a6e43..ea3e585 100644 --- a/doc/runsvchdir.8.html +++ b/doc/runsvchdir.8.html @@ -20,8 +20,8 @@ If dir does not start with a slash, it is searched in /etc/runit/runsvdir runsvchdir switches to the directory /etc/runit/runsvdir/, copies current to previous, and replaces current with a symlink pointing to dir.

-Normally /var/service is a symlink to current, and runsvdir(8) -is running /var/service/. +Normally /service is a symlink to current, and runsvdir(8) +is running /service/.

Exit Codes

runsvchdir prints an error message and exits 111 on error. runsvchdir exits 0 on success. diff --git a/doc/sv.8.html b/doc/sv.8.html index fc688b5..1fb4d84 100644 --- a/doc/sv.8.html +++ b/doc/sv.8.html @@ -21,7 +21,7 @@ monitored by the runsv(8) supervisor.

services consists of one or more arguments, each argument naming a directory service used by runsv(8). If service doesn’t start with a dot or slash, it is searched in the default services directory -/var/service/, otherwise relative to the current directory.

+/service/, otherwise relative to the current directory.

command is one of up, down, status, once, pause, cont, hup, alarm, interrupt, 1, 2, term, kill, or exit, or start, stop, restart, shutdown, force-stop, force-reload, @@ -157,7 +157,7 @@ implies -v.

SVDIR
The environment variable $SVDIR overrides the -default services directory /var/service/.
+default services directory /service/.
SVWAIT
The environment variable diff --git a/doc/useinit.html b/doc/useinit.html index eb420b9..58adec2 100644 --- a/doc/useinit.html +++ b/doc/useinit.html @@ -21,10 +21,10 @@ adding /sbin/runsvdir-start to the system's StartupItems.

In any case, you first need to copy the stage 2 script to /sbin/runsvdir-start, and create the services directory -/var/service/: +/service/:

  # install -m0750 /package/admin/runit/etc/2 /sbin/runsvdir-start
- # mkdir -p /var/service
+ # mkdir -p /service
 

How to use with sysvinit and inittab
diff --git a/doc/utmpset.8.html b/doc/utmpset.8.html index f433c3e..3b96cb6 100644 --- a/doc/utmpset.8.html +++ b/doc/utmpset.8.html @@ -23,7 +23,7 @@ update the utmp file, the getty(8) processes are handled the same other services.

To enable local login accounting, add utmpset to the getty(8) finish scripts, e.g.:

- $ cat /var/service/getty-5/finish
+ $ cat /service/getty-5/finish
#!/bin/sh
exec utmpset -w tty5
$
diff --git a/etc/2 b/etc/2 index 9720c3e..3bb822d 100755 --- a/etc/2 +++ b/etc/2 @@ -3,4 +3,4 @@ PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin exec env - PATH=$PATH \ -runsvdir -P /var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' +runsvdir -P /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/etc/debian/3 b/etc/debian/3 index 5931ce6..10354d7 100755 --- a/etc/debian/3 +++ b/etc/debian/3 @@ -7,8 +7,8 @@ LAST=0 test -x /etc/runit/reboot && LAST=6 echo 'Waiting for services to stop...' -sv -w196 force-stop /var/service/* -sv exit /var/service/* +sv -w196 force-stop /service/* +sv exit /service/* echo 'Shutdown...' /etc/init.d/rc $LAST diff --git a/etc/freebsd/3 b/etc/freebsd/3 index c30bdb1..f7f9327 100755 --- a/etc/freebsd/3 +++ b/etc/freebsd/3 @@ -4,8 +4,8 @@ exec 2>&1 PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin echo 'Waiting for services to stop...' -sv -w196 force-stop /var/service/* -sv exit /var/service/* +sv -w196 force-stop /service/* +sv exit /service/* echo 'Shutdown...' if test -x /etc/runit/reboot; then diff --git a/etc/macosx/StartupItems/runit b/etc/macosx/StartupItems/runit index 6b4f0c4..9f0eaf3 100755 --- a/etc/macosx/StartupItems/runit +++ b/etc/macosx/StartupItems/runit @@ -12,8 +12,8 @@ StartService() { } StopService() { ConsoleMessage "Stopping runit service supervision" - sv -w196 force-stop /var/service/* - sv exit /var/service/* + sv -w196 force-stop /service/* + sv exit /service/* } RestartService() { return 0 diff --git a/etc/macosx/org.smarden.runit.plist b/etc/macosx/org.smarden.runit.plist index 5c4820f..1331f8a 100644 --- a/etc/macosx/org.smarden.runit.plist +++ b/etc/macosx/org.smarden.runit.plist @@ -8,7 +8,7 @@ runsvdir - starts and monitors a collection of runsv(8) processes QueueDirectories - /var/service + /service OnDemand diff --git a/etc/openbsd/3 b/etc/openbsd/3 index c30bdb1..f7f9327 100755 --- a/etc/openbsd/3 +++ b/etc/openbsd/3 @@ -4,8 +4,8 @@ exec 2>&1 PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin echo 'Waiting for services to stop...' -sv -w196 force-stop /var/service/* -sv exit /var/service/* +sv -w196 force-stop /service/* +sv exit /service/* echo 'Shutdown...' if test -x /etc/runit/reboot; then diff --git a/man/runsv.8 b/man/runsv.8 index 53f1b1b..7c5abfc 100644 --- a/man/runsv.8 +++ b/man/runsv.8 @@ -157,9 +157,9 @@ This command is ignored if it is given to .IR service /log/supervise/control. .P Example: to send a TERM signal to the socklog-unix service, either do - # sv term /var/service/socklog-unix + # sv term /service/socklog-unix or - # printf t >/var/service/socklog-unix/supervise/control + # printf t >/service/socklog-unix/supervise/control .P .BR printf (1) usually blocks if no diff --git a/man/runsvchdir.8 b/man/runsvchdir.8 index 793d653..f7f94dc 100644 --- a/man/runsvchdir.8 +++ b/man/runsvchdir.8 @@ -27,13 +27,13 @@ with a symlink pointing to .IR dir . .P Normally -.I /var/service +.I /service is a symlink to .IR current , and .BR runsvdir (8) is running -.IR /var/service/ . +.IR /service/ . .SH EXIT CODES .B runsvchdir prints an error message and exits 111 on error. diff --git a/man/sv.8 b/man/sv.8 index 9de05e4..cbce14e 100644 --- a/man/sv.8 +++ b/man/sv.8 @@ -30,7 +30,7 @@ If .I service doesn't start with a dot or slash and doesn't end with a slash, it is searched in the default services directory -.IR /var/service/ , +.IR /service/ , otherwise relative to the current directory. .P .I command @@ -217,7 +217,7 @@ This option implies .TP .B SVDIR The environment variable $SVDIR overrides the default services directory -.IR /var/service/ . +.IR /service/ . .TP .B SVWAIT The environment variable $SVWAIT overrides the default 7 seconds to wait diff --git a/man/utmpset.8 b/man/utmpset.8 index c93fe83..4f9b4ef 100644 --- a/man/utmpset.8 +++ b/man/utmpset.8 @@ -34,7 +34,7 @@ to the .I finish scripts, e.g.: .P - $ cat /var/service/getty-5/finish + $ cat /service/getty-5/finish #!/bin/sh exec utmpset \-w tty5 $ diff --git a/package/CHANGES b/package/CHANGES index b026c96..1ec4099 100644 --- a/package/CHANGES +++ b/package/CHANGES @@ -1,6 +1,7 @@ * doc/upgrade.html: typo. * sv.c: service name is also relative to the current directory if it ends with a slash. + * change default directory for services from /var/service/ to /service/. 1.8.0 Fri, 21 Sep 2007 00:33:56 +0000 diff --git a/src/sv.c b/src/sv.c index 0559abe..8269ca7 100644 --- a/src/sv.c +++ b/src/sv.c @@ -32,7 +32,7 @@ char *progname; char *action; char *acts; -char *varservice ="/var/service/"; +char *varservice ="/service/"; char **service; char **servicex; unsigned int services; -- cgit 1.4.1