Commit Graph

150 Commits

Author SHA1 Message Date
William Hubbs
b79d058f16 s6: Use s6-svc -Dd to stop services
This allows us to get rid of the sleep call in the stop function. Also,
we set a configurable timeout value for stopping daemons.
2015-05-14 11:40:29 -05:00
William Hubbs
e372f97beb Fix the s6 handling
This changes the default s6 service directory to /var/svc.d, also
it changes the code to work with the individual services instead of
forcing a rescan when a service is started or stopped.
2015-05-13 16:10:08 -05:00
William Hubbs
bb2d7becfd Add support for the s6 supervision suite 2015-05-11 18:36:49 -05:00
William Hubbs
0f9354becf man: Clarify the documentation for command_args
The command_args variable only works if using start-stop-daemon to start
the daemon.
2015-05-11 15:37:30 -05:00
S. Gilles
dff6e4a004 Fix mdoc warning for empty line in rc-update man page.
X-Gentoo-Bug: 529374
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=529374
2014-11-22 11:49:46 -06:00
William Hubbs
8c7ea4e9e8 runscript.sh: add chroot support
This adds support for a chroot variable which will be passed to the
start-stop-daemon --chroot switch to runscript.sh when starting a
daemon. This also needs to be saved so it can be used in locating the
pid file when stopping the daemon.

X-Gentoo-Bug: 524388
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524388
2014-10-20 15:44:19 -05:00
William Hubbs
20006625a6 man: Document start_inactive and in_background_fake 2014-09-19 17:23:55 -05:00
William Hubbs
40141244e3 man/openrc-run.8: more updates and clarifications for checkpath
X-Gentoo-Bug: 500606
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
2014-07-13 11:23:43 -05:00
Alexander V Vershilov
d59737afb1 man/openrc.8: update checkpath documentation
X-GENTOO-BUG: 500606
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
2014-07-13 08:50:36 -05:00
Alexander V Vershilov
f66f41c4f0 typo fix 2014-07-11 16:36:35 -05:00
William Hubbs
23cb55d843 man/start-stop-daemon.8: correct argument from --nice to --nicelevel
X-Gentoo-Bug: 510648
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=510648
2014-06-21 01:53:17 -05:00
Benda Xu
abadaa04ab rc-update: add option to remove a service from all runlevels
The -a option,which only applies to the del command, is used to remove a
service from all runlevels.

X-Gentoo-Bug: 497740
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=497740
2014-01-13 10:41:38 -06:00
William Hubbs
e5a94dd3f4 Add missing documentation for environment variables
Add documentation for the RC_SERVICE, RC_GOINGDOWN, RC_LIBEXECDIR and
RC_NO_UMOUNTS environment variables.

X-Gentoo-Bug: 489344
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489344
2014-01-08 13:16:27 -06:00
William Hubbs
3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00
William Hubbs
7b5fa011ac Rename the rc binary to openrc
Debian requested this rename due to the "rc" binary conflicting with the
"rc" binary from the plan 9 shell.

We also add a deprecation warning to the binary when it is run as rc to
encourage users to switch to openrc instead.

X-Gentoo-Bug: 493958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493958
2013-12-12 18:31:29 -06:00
William Hubbs
48981be8a8 Revert "Make einfo routines private"
This reverts commit de88aff0a8.
I was advised that splashutils links to libeinfo, so we do have a
consumer for this library.
2013-10-21 13:49:41 -05:00
William Hubbs
de88aff0a8 Make einfo routines private
The libeinfo library has no consumers other than OpenRC, so there is no
reason for it to be maintained as a library. The einfo routines are now
an object that links with the rc binary.
2013-09-26 22:18:21 -05:00
William Hubbs
2590bf7a2b libeinfo: add separate variable to suppress eerror messages
Add an EERROR_QUIET environment variable which works like EINFO_QUIET
but for the eerror functions. This will allow library consumers to
choose whether to suppress eerror messages separately from einfo and
ewarn messages.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-09-03 13:03:55 -05:00
William Hubbs
a78b18e291 libeinfo: suppress output for eerror* functions
This makes the eerror* functions honor the EINFO_QUIET environment
variable like the einfo* and ewarn* functions.

X-Gentoo-Bug: 482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
2013-08-28 14:23:46 -05:00
William Hubbs
72b58b9e6b Revert "Libeinfo: do not suppress ewarn() messages"
This reverts commit 4ee62c7903.

The previously referenced commit broke consistency because ewarnx() was
respecting the EINFO_QUIET environment setting, but after this commit,
ewarn() was not.
Also, due to discussion on the below referenced bugs, I think we do
want to suppress warnings when EINFO_QUIET=yes.

X-Gentoo-Bug: 482396
X-Gentoo-Bug: 439174
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439174
2013-08-27 10:26:48 -05:00
William Hubbs
7296379f3f man/runscript.8: minor grammar fixes 2013-08-24 11:57:22 -05:00
William Hubbs
1f5d447eda fix typo on runscript man page
The example code had an invalid checkpath option (--dir instead of
--directory) and a mode that does not make sense for directories (664
instead of 775).

X-Gentoo-Bug: 481034
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=481034
2013-08-15 10:14:42 -05:00
William Hubbs
b2f8ac9382 Clarify the documentation about the restart function
Restart has never been able to be overridden in OpenRc, but there is a
way to make your service script behave differently when restart is being
executed.

X-Gentoo-Bug: 480866
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=480866
2013-08-13 12:12:43 -05:00
William Hubbs
a09a60c4cf Add service applet
The service applet is equivalent to rc-service. This was added so that
we will be more compatible with Debian and Fedora.

Reported-by: cardoe@gentoo.org
X-Gentoo-Bug: 468168
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=468168
2013-05-02 13:52:27 -05:00
William Hubbs
10a4385e40 rc: allow switching runlevels without stopping services
OpenRC, by default, stops all services that are not listed in a runlevel
when rc is used to switch runlevels. This adds a -n/--no-stop command
line option to rc which tells it to skip stopping the services which are
not in the runlevel.

Reported-by: gentoo@thoth.purplefrog.com
X-Gentoo-Bug: 372585
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=372585
2013-04-28 12:51:12 -05:00
William Hubbs
879c7f04ec runscript: update documentation for the provide function
Explain that virtual services take precedence over real services and
recommend that virtual services have different names from real services.

Reported-by: me@2gw.net
X-Gentoo-Bug: 461818
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=461818
2013-03-20 15:42:09 -05:00
Andrew Gregory
06658d1038 fix typo in rc-status.8
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-21 19:51:09 -05:00
Christian Ruppert
a3ff6cce97 Revert "Prepare for real "restart" support"
This reverts commit c5bb6829d0.

That was meant for my local devel branch :)
2012-10-16 21:28:45 +02:00
Christian Ruppert
c5bb6829d0 Prepare for real "restart" support 2012-10-12 21:07:59 +02:00
William Hubbs
c08b1a6a32 small runscript man page cleanups 2012-09-25 12:09:45 -05:00
William Hubbs
5615fa78d6 Drop restart_pre/restart_post
By design, restart is hard coded to run stop followed by start along
with all of the pre/post functions associated with them. Restart doesn't
need its own pre/post functions since it is possible to make any
function in an init script behave differently for a restart command by
testing against the RC_CMD environment variable.
2012-09-25 10:22:47 -05:00
William Hubbs
f007988fba Clarify how to handle restart processing
The Gentoo developer manual covers how to handle restarts in init
scripts, but this was not officially covered in OpenRc's Documentation.
This commit adds an example to the runscript man page that shows how
this works.
2012-09-23 19:25:57 -05:00
Christian Ruppert
0406c6085b Add restart_pre/restart_post support, also document RC_CMD 2012-09-22 16:57:46 +02:00
William Hubbs
5092595835 add RC_PREFIX environment variable
This will be used by init scripts which want to be able to run in a
Gentoo Prefix installation. RC_PREFIX will contain the prefix offset.
2012-09-09 22:22:15 -05:00
William Hubbs
e641b43849 Bring Back prefix support
We now have a team member who is interested in OpenRC on prefix, so I am
bringing it back to the main tree.
2012-07-26 10:54:48 -05:00
William Hubbs
eb11953dd2 Document the required_dirs and required_files variables 2012-03-24 12:40:45 -05:00
William Hubbs
9fa54a8e80 Runscript: allow extra_commands to be run in chroots
The commands defined in the extra_commands variable do not depend on
whether the service is stopped or started, so it is valid to run them in
chroot environments.

Also, add a note to the runscript man page about the commands in
extra_commands being able to run whether or not the service is started.

Reported-by: Robin Johnson <robbat2@gentoo.org>
X-Gentoo-Bug: 406713
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=406713
2012-03-03 09:22:44 -06:00
William Hubbs
3247184d86 Remove prefix support
I spoke with the prefix team sometime back and was told that they do not
have an interest in using OpenRC on prefix systems.
2012-02-21 07:27:16 -06:00
William Hubbs
47c3b28459 Clarify the documentation about the reboot runlevel
The reboot runlevel does exist, but it gets remapped to the shutdown
runlevel internally.
2012-02-19 13:11:11 -06:00
William Hubbs
f18763bcd8 Document the RC_REBOOT variable 2012-02-19 12:49:53 -06:00
Christian Ruppert
7ea5c614d9 Add -W/--writable function to checkpath
Checkpath -W will use access(3p) to determine whether or not a path is
writable. This is more accurate than test(1p) because it also takes into
account whether or not the filesystem is mounted read-only.

Modified by William Hubbs to add the man page update.
2012-01-26 14:42:18 -06:00
Christian Ruppert
2990e5a2e3 Whitespace 2012-01-22 01:17:42 +01:00
Christian Ruppert
9c0edc5c52 Use the "--make-pidfile" when command_background is used
The start-stop-daemon "--make-pidfile" option is now used by default when using
command_background, this requires a pidfile to be specified.
Document command_background option.

Reported-by: Giampaolo Tomassoni <giampaolo@tomassoni.biz>
X-Gentoo-Bug: 399165
X-Gentoo-Bug-URL: https://bugs.gentoo.org/399165
2012-01-17 18:25:44 +01:00
Christian Ruppert
30a56cdb46 Add "ifstopped" command to runscript
Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
2012-01-15 02:10:35 +01:00
Robin H. Johnson
66f4305e1c rc/checkpath: tmpfiles.d backend creation code
This commit provides the checkpath applet with feature parity to
systemd's tmpfiles.c create_item function.

Very similarly to the systemd function, it does NOT do any of the
cleanup work in this function.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-09 19:20:47 -08:00
William Hubbs
1771a83b92 Reword the documentation for the retry option for start-stop-daemon 2011-12-30 22:20:03 -06:00
William Hubbs
e873ef2ba7 Reword retry documentation on runscript man page 2011-12-30 22:12:59 -06:00
Christian Ruppert
26edfe369c Fix the description of --retry in start-stop-daemon(8)
X-Gentoo-Bug: 368615
X-Gentoo-Bug-URL: https://bugs.gentoo.org/368615
Reported-by: Stuart Shelton <srcshelton@gmail.com>
2011-12-31 03:43:25 +01:00
Christian Ruppert
fb8db18d79 Add "retry" option for the stop() template 2011-12-31 02:41:59 +01:00
William Hubbs
810f2e55fb Documentation updates
- Clarify that start_stop_daemon_args is only used when starting a
  daemon.
- fix several typos.
2011-12-30 10:35:16 -06:00