From 38a803a1f86b459d193aa234d00b1af3895edab1 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 05:00:41 +0300 Subject: Add a systemd service for OTP releases --- rel/files/installation/pleroma.service | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 rel/files/installation/pleroma.service (limited to 'rel/files/installation') diff --git a/rel/files/installation/pleroma.service b/rel/files/installation/pleroma.service new file mode 100644 index 000000000..e47cf58dc --- /dev/null +++ b/rel/files/installation/pleroma.service @@ -0,0 +1,36 @@ +[Unit] +Description=Pleroma social network +After=network.target postgresql.service nginx.service + +[Service] +KillMode=process +Restart=on-failure + +; Name of the user that runs the Pleroma service. +User=pleroma + +; Make sure that all paths fit your installation. +; Path to the home directory of the user running the Pleroma service. +Environment="HOME=/opt/pleroma" +; Path to the folder containing the Pleroma installation. +WorkingDirectory=/opt/pleroma +; Path to the Pleroma binary. +ExecStart=/opt/pleroma/bin/pleroma start +ExecStop=/opt/pleroma/bin/pleroma stop + +; Some security directives. +; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops. +PrivateTmp=true +; The /home, /root, and /run/user folders can not be accessed by this service anymore. If your Pleroma user has its home folder in one of the restricted places, or use one of these folders as its working directory, you have to set this to false. +ProtectHome=true +; Mount /usr, /boot, and /etc as read-only for processes invoked by this service. +ProtectSystem=full +; Sets up a new /dev mount for the process and only adds API pseudo devices like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled by default because it may not work on devices like the Raspberry Pi. +PrivateDevices=false +; Ensures that the service process and all its children can never gain new privileges through execve(). +NoNewPrivileges=true +; Drops the sysadmin capability from the daemon. +CapabilityBoundingSet=~CAP_SYS_ADMIN + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3 From bb40c33dd65aaeafaf3b74f4557deb75b0da8e93 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 13:24:33 +0300 Subject: Add an OpenRC service for OTP releases --- rel/files/installation/init.d/pleroma | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 rel/files/installation/init.d/pleroma (limited to 'rel/files/installation') diff --git a/rel/files/installation/init.d/pleroma b/rel/files/installation/init.d/pleroma new file mode 100755 index 000000000..de007c5e3 --- /dev/null +++ b/rel/files/installation/init.d/pleroma @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +# Requires OpenRC >= 0.35 +directory=/opt/pleroma + +command=/opt/pleroma/bin/pleroma +command_args="start" +command_user=pleroma +command_background=1 + +# Ask process to terminate within 30 seconds, otherwise kill it +retry="SIGTERM/30/SIGKILL/5" + +pidfile="/var/run/pleroma.pid" + +depend() { + need nginx postgresql +} -- cgit v1.2.3 From 5b76c3141f7945f76b8f3f84990cce8332152f71 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 10:08:33 +0300 Subject: Use supervise-daemon(8) for the alpine service --- rel/files/installation/init.d/pleroma | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rel/files/installation') diff --git a/rel/files/installation/init.d/pleroma b/rel/files/installation/init.d/pleroma index de007c5e3..dea1db26c 100755 --- a/rel/files/installation/init.d/pleroma +++ b/rel/files/installation/init.d/pleroma @@ -1,5 +1,7 @@ #!/sbin/openrc-run +supervisor=supervise-daemon + # Requires OpenRC >= 0.35 directory=/opt/pleroma @@ -14,5 +16,6 @@ retry="SIGTERM/30/SIGKILL/5" pidfile="/var/run/pleroma.pid" depend() { - need nginx postgresql + want nginx + need postgresql } -- cgit v1.2.3