Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
fix: sysvinit invoke via path lookup, not /sbin
Browse files Browse the repository at this point in the history
The sysvinit scripts assume the install is in /sbin, and hardcode that
as the invocation path, even though the 'configure' script itself
defaults to /usr/local if no --prefix override is given (as standard for
autoconf).

This means an out-of-box compile will not even work with the provided
init scripts without modifying them by hand.

The locations used are:

  - /usr/local/sbin/cgmanager: installation default
  - /usr/bin/cgmanager: gentoo scripts assumption
  - /sbin/cgmanager: debian packages give this prefix (and this is what
                     the script hardcodes)

Instead of harcoding one of the paths, have the init script look up the
invocation path at runtime to invoke cgmanager (although we still use a
hardcoded PATH, but include all three locations).
  • Loading branch information
smemsh committed Jan 30, 2016
1 parent 76c28a7 commit 34060df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/init/sysvinit/cgmanager
Expand Up @@ -15,15 +15,15 @@

# Do NOT "set -e"

PATH=/sbin:/bin
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DAEMON=/sbin/cgmanager
DAEMON="$(which cgmanager)"
NAME=cgmanager
DESC="cgroup management daemon"

BASEOPTS="--daemon -m name=systemd"

test -x $DAEMON || exit 0
test -x "$DAEMON" || exit 0

PIDFILE=/run/$NAME.pid

Expand Down
6 changes: 3 additions & 3 deletions config/init/sysvinit/cgproxy
Expand Up @@ -15,15 +15,15 @@

# Do NOT "set -e"

PATH=/sbin:/bin
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DAEMON=/sbin/cgproxy
DAEMON="$(which cgproxy)"
NAME=cgproxy
DESC="cgroup management proxy daemon"

BASEOPTS="--daemon"

test -x $DAEMON || exit 0
test -x "$DAEMON" || exit 0

PIDFILE=/run/$NAME.pid

Expand Down

0 comments on commit 34060df

Please sign in to comment.