ソースを参照

Add system start-up files for guix-daemon.

* etc/init.d/guix-daemon.in: New file.
* nix/local.mk (etc/init.d/guix-daemon): New rule.
(nodist_sysvinitservice_DATA): Add etc/init.d/guix-daemon.in .
(CLEANFILES): Add etc/init.d/guix-daemon .
* .gitignore: Add etc/init.d/guix-daemon .
gn-latest-20200428
Danny Milosavljevic 8ヶ月前
コミット
73fbe04107
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: E71A35542C30BAA5
3個のファイルの変更93行の追加2行の削除
  1. +1
    -0
      .gitignore
  2. +78
    -0
      etc/init.d/guix-daemon.in
  3. +14
    -2
      nix/local.mk

+ 1
- 0
.gitignore ファイルの表示

@@ -71,6 +71,7 @@
/etc/guix-daemon.service
/etc/guix-publish.conf
/etc/guix-publish.service
/etc/init.d/guix-daemon
/guix-daemon
/guix/config.scm
/libformat.a


+ 78
- 0
etc/init.d/guix-daemon.in ファイルの表示

@@ -0,0 +1,78 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: guix-daemon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Guix build daemon
# Description: Provides a daemon that does builds for Guix
### END INIT INFO

set -e
mkdir -p "/var/run"
if [ ! -f "@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon" ]
then
exit 5
fi

case "$1" in
start)
if [ -f "/var/run/guix-daemon.pid" ]
then
if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
then
exit 0
else
echo "guix-daemon has a stale pid file" >&2
exit 1
fi
else
daemonize \
-a \
-e "/var/log/guix-daemon-stderr.log" \
-o "/var/log/guix-daemon-stdout.log" \
-E GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale \
-E LC_ALL=en_US.utf8 \
-p "/var/run/guix-daemon.pid" \
@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
--build-users-group=guixbuild
fi
;;
stop)
if [ -f "/var/run/guix-daemon.pid" ]
then
pkill -F "/var/run/guix-daemon.pid" guix-daemon || {
exit 1
}
rm -f "/var/run/guix-daemon.pid"
exit 0
else
exit 0
fi
;;
status)
if [ -f "/var/run/guix-daemon.pid" ]
then
if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
then
echo "guix-daemon is running"
exit 0
else
echo "guix-daemon has a stale pid file"
exit 1
fi
else
echo "guix-daemon is not running"
exit 3
fi
;;
restart|force-reload)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 (start|stop|status|restart|force-reload)"
exit 3
;;
esac

+ 14
- 2
nix/local.mk ファイルの表示

@@ -164,6 +164,16 @@ etc/guix-%.service: etc/guix-%.service.in \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"

sysvinitservicedir = $(sysconfdir)/init.d
nodist_sysvinitservice_DATA = etc/init.d/guix-daemon

etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
$(top_builddir)/config.status
$(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
$(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
"$<" > "$@.tmp"; \
mv "$@.tmp" "$@"

# The '.conf' jobs for Upstart.
upstartjobdir = $(libdir)/upstart/system
nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
@@ -177,7 +187,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \

CLEANFILES += \
$(nodist_systemdservice_DATA) \
$(nodist_upstartjob_DATA)
$(nodist_upstartjob_DATA) \
$(nodist_sysvinitservice_DATA)

EXTRA_DIST += \
%D%/AUTHORS \
@@ -185,7 +196,8 @@ EXTRA_DIST += \
etc/guix-daemon.service.in \
etc/guix-daemon.conf.in \
etc/guix-publish.service.in \
etc/guix-publish.conf.in
etc/guix-publish.conf.in \
etc/init.d/guix-daemon.in

if CAN_RUN_TESTS



読み込み中…
キャンセル
保存