diff --git a/etc/group b/etc/group index a298035..1270985 100644 --- a/etc/group +++ b/etc/group @@ -1,4 +1,5 @@ root:x:0:root dnsmasq:x:963:dnsmasq sshd:x:33:sshd -nobody:x:65534: \ No newline at end of file +nobody:x:65534: +gitea:x:1000: \ No newline at end of file diff --git a/etc/passwd b/etc/passwd index 72f2cb6..db26337 100644 --- a/etc/passwd +++ b/etc/passwd @@ -1,4 +1,5 @@ root:x:0:0:root:/root:/bin/sh dnsmasq:x:963:963:dnsmasq daemon:/:/usr/bin/nologin sshd:x:33:33:SSH daemon:/var/lib/sshd:/bin/sh -nobody:x:65534:65534:Kernel Oerflow User:/:/usr/bin/nologin \ No newline at end of file +nobody:x:65534:65534:Kernel Oerflow User:/:/usr/bin/nologin +gitea:x:1000:1000:Gitea daemon user:/home/gitea:/bin/sh \ No newline at end of file diff --git a/usr/lib/init/services/gitea.service b/usr/lib/init/services/gitea.service new file mode 100644 index 0000000..8a23cdc --- /dev/null +++ b/usr/lib/init/services/gitea.service @@ -0,0 +1,33 @@ +#!/bin/sh + +#--- import colors and init-funcs --- +. /usr/lib/init/colors.sh +. /usr/lib/init/init-funcs.sh +#------------------------------------ + +start() { + otify "Starting gitea" + su gitea -c "/usr/bin/gitea -w /home/gitea" + check $? "start gitea" + echo $(pgrep gitea) > /var/run/gitea.pid + return $? +} + +stop() { + notify "Stopping gitea" + kill $(cat /var/run/gitea.pid) + check $? "stop gitea" + rm /var/run/gitea.pid &> /dev/null + return $? +} + +case "$1" in + start|stop|restart|reload|help) + "$1" + ;; + *) + help + return 1 + ;; +esac +return $?