added gitea.service

This commit is contained in:
wt
2024-12-12 17:29:52 +07:00
parent e5966f1bd3
commit 149aad7741
3 changed files with 37 additions and 2 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
root:x:0:root root:x:0:root
dnsmasq:x:963:dnsmasq dnsmasq:x:963:dnsmasq
sshd:x:33:sshd sshd:x:33:sshd
nobody:x:65534: nobody:x:65534:
gitea:x:1000:
+2 -1
View File
@@ -1,4 +1,5 @@
root:x:0:0:root:/root:/bin/sh root:x:0:0:root:/root:/bin/sh
dnsmasq:x:963:963:dnsmasq daemon:/:/usr/bin/nologin dnsmasq:x:963:963:dnsmasq daemon:/:/usr/bin/nologin
sshd:x:33:33:SSH daemon:/var/lib/sshd:/bin/sh sshd:x:33:33:SSH daemon:/var/lib/sshd:/bin/sh
nobody:x:65534:65534:Kernel Oerflow User:/:/usr/bin/nologin nobody:x:65534:65534:Kernel Oerflow User:/:/usr/bin/nologin
gitea:x:1000:1000:Gitea daemon user:/home/gitea:/bin/sh
+33
View File
@@ -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 $?