unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 8974a5d2150362b003edb473f35fe7168b9d0c4d 1936 bytes (raw)
name: etc/init.d/guix-daemon.in 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
#!/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
set -o pipefail
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
    pid="`cat /var/run/guix-daemon.pid`"
    if ps www "${pid}" |grep -qa 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
    pid="`cat /var/run/guix-daemon.pid`"
    if ps www "${pid}" |grep -qa guix-daemon
    then
      kill "${pid}"
      sleep 10
      kill -9 "${pid}" || true
      exit 0
    else
      echo "guix-daemon has a stale pid file" >&2
      exit 1
    fi
  else
    exit 0
  fi
  ;;
status)
  if [ -f "/var/run/guix-daemon.pid" ]
  then
    pid="`cat /var/run/guix-daemon.pid`"
    if ps www "${pid}" |grep -qa 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

debug log:

solving 8974a5d215 ...
found 8974a5d215 in https://yhetil.org/guix-patches/20200128155900.12137-1-dannym@scratchpost.org/

applying [1/1] https://yhetil.org/guix-patches/20200128155900.12137-1-dannym@scratchpost.org/
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
new file mode 100644
index 0000000000..8974a5d215

Checking patch etc/init.d/guix-daemon.in...
Applied patch etc/init.d/guix-daemon.in cleanly.

index at:
100644 8974a5d2150362b003edb473f35fe7168b9d0c4d	etc/init.d/guix-daemon.in

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).