Commit Graph

19 Commits

Author SHA1 Message Date
William Hubbs
731a3affdc Fix script execution in the local service
The local service should use eval when it executes scripts since it has
the redirection set up in a variable.

This fixes #50.
X-Gentoo-Bug: 545012
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=545012
2015-04-08 09:37:04 -05:00
William Hubbs
9dfb85d5d2 local: fix redirections
The local service now redirects stdout and stderr for the scripts it
runs to /dev/null unless it is run in verbose mode.

X-Gentoo-Bug: 537444
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537444
2015-02-18 09:58:54 -06:00
William Hubbs
57b9e601a9 init.d/local: bring functioning more in line with how sysctl works
- remove the has_executables variable since it isn't used.
- Convert the conditional calls to ewend/vewend to a single call to veend.
- Always call eend after all scripts are executed passing the appropriate
error code.

Because of this change, you will see only an overall status when
starting or stopping local unless you are using verbose mode.
2014-07-09 15:33:48 -05:00
Thomas D
c1de8c09bf Add support for verbose "local" service runscript
With this patch, the "local" service runscript will be verbose like the
"sysctl" service when 'rc_verbose="yes"' is set.

Example output successful start:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]

Example output with failing executables:

 * Stopping local ...
 *   Executing "/etc/local.d/00will-stop.stop" ...                  [ ok ]
 *   Executing "/etc/local.d/will-fail.stop" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.stop" failed.             [ !! ]
 * Starting local ...
 *   Executing "/etc/local.d/00will-start.start" ...                [ ok ]
 *   Executing "/etc/local.d/01 test.start" ...                     [ ok ]
 *   Executing "/etc/local.d/will-fail2.start" ...
mount: can't find bar in /etc/fstab
 *   Execution of "/etc/local.d/will-fail2.start" failed.           [ !! ]
 *   Executing "/etc/local.d/will-fail.start" ...
mount: can't find foo in /etc/fstab
 *   Execution of "/etc/local.d/will-fail.start" failed.            [ !! ]

X-Gentoo-Bug: 489274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489274
2014-07-05 13:12:30 -05: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
60d288a877 remove type command
The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.
2013-12-02 02:08:40 -06:00
Andrew Gregory
8a44067838 Fix shebangs in services to point to the correct location of runscript
SBINDIR and BINDIR can be set independently of PREFIX.  This fixes
broken shebangs in service files when SBINDIR is set to something other
than PREFIX/sbin

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-23 20:30:39 -06:00
Mike Frysinger
d0bc4f20ad drop useless "All rights reserved" notice
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-29 19:46:31 -04:00
William Hubbs
8202e7dce4 add back the eend command in start/stop for local service
This was added back due to a user request. It will always be on a line
of its ownbecause I'm considering adding more verbose info messages to
local that show when each service is run if local is run with the -v
option.

X-Gentoo-Bug: 363343
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=363343
2011-04-21 13:02:49 -05:00
Mike Frysinger
35d38c3561 local: quote script names to handle spaces
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-14 12:06:58 -05:00
William Hubbs
10ce67886d change local to run programs
This changes the local service so that it will run programs located in
@sysconfdir@/local.d instead of the local_start and local_stop functions
from @sysconfdir@/conf.d/local.

The advantage for the user is that these programs are not part
of the openrc package, so the user does not have to worry about them
being overwritten when openrc is upgraded.

X-Gentoo-Bug: 351465
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=351465
2011-01-20 12:50:29 -06:00
William Hubbs
6d9137d6c4 remove support for local.start and local.stop for bug #343709
The openrc ebuild now migrates these files to /etc/conf.d/local, so we
do not need to support them.
2010-11-10 10:55:28 -06:00
William Hubbs
2fa6bb0d48 add warnings about local.start and local.stop for bug #343709
We need to warn users that they should be using /etc/conf.d/local
instead of /etc/conf.d/local.start and /etc/conf.d/local.stop. This adds
those warnings.
2010-11-05 13:42:33 -05:00
Roy Marples
b4104957b1 We should use -feature instead of nofeature.
This matches the ifconfig and Gentoo USE flag syntax and is hopefully
easier to read.
Fixes #178.
2009-07-01 00:07:32 +01:00
Roy Marples
658a220638 Add (c) to Copyright 2009-05-01 15:11:40 +01:00
Roy Marples
f6e3c167ae Remove bash localisation feature, Gentoo #244444 thanks to Andrey Grozin. 2008-10-26 19:19:19 +00:00
Roy Marples
a689b66023 Add tunable SYSCONFDIR 2008-03-05 12:27:11 +00:00
Roy Marples
67c5fd6bb8 Ensure that our scripts call prefixed runscript. 2008-03-02 21:14:01 +00:00
Roy Marples
a12dbdc6c9 Don't check for root in prefix. 2008-03-02 21:13:21 +00:00