From 3a4773c3c2bd0bbef244eb519b07208da9108e49 Mon Sep 17 00:00:00 2001 From: dcc Date: Sat, 2 Sep 2023 00:52:52 -0700 Subject: First --- rel/files/installation/init.d/pleroma | 21 ++++++++++++++++++++ rel/files/installation/pleroma.service | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 rel/files/installation/init.d/pleroma create mode 100644 rel/files/installation/pleroma.service (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 0000000..dea1db2 --- /dev/null +++ b/rel/files/installation/init.d/pleroma @@ -0,0 +1,21 @@ +#!/sbin/openrc-run + +supervisor=supervise-daemon + +# 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() { + want nginx + need postgresql +} diff --git a/rel/files/installation/pleroma.service b/rel/files/installation/pleroma.service new file mode 100644 index 0000000..e47cf58 --- /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