install systemd services in /etc/systemd/system, /lib/systemd could be mounted read only in the future

This commit is contained in:
j 2016-06-09 12:38:13 +02:00
parent 05c4cfcbc8
commit ed215174f8

13
ctl
View file

@ -40,10 +40,15 @@ if [ "$action" = "install" ]; then
cd "`dirname "$0"`" cd "`dirname "$0"`"
BASE=`pwd` BASE=`pwd`
if [ -x /bin/systemctl ]; then if [ -x /bin/systemctl ]; then
if [ -d /lib/systemd/system/ ]; then if [ -d /etc/systemd/system/ ]; then
cp $BASE/etc/systemd/*.service /lib/systemd/system/ rm -f /lib/systemd/system/pandora.service \
cp $BASE/etc/tmpfiles.d/pandora.conf /usr/lib/tmpfiles.d/ /lib/systemd/system/pandora-cron.service \
systemd-tmpfiles --create /usr/lib/tmpfiles.d/pandora.conf >/dev/null || true /lib/systemd/system/pandora-encoding.service \
/lib/systemd/system/pandora-tasks.service \
/lib/systemd/system/pandora-websocketd.service
cp $BASE/etc/systemd/*.service /etc/systemd/system/
cp $BASE/etc/tmpfiles.d/pandora.conf /etc/tmpfiles.d/
systemd-tmpfiles --create /etc/tmpfiles.d/pandora.conf >/dev/null || true
systemctl daemon-reload systemctl daemon-reload
for service in $SERVICES; do for service in $SERVICES; do
systemctl enable ${service}.service systemctl enable ${service}.service