Created
August 24, 2022 02:22
-
-
Save ar/02632d1033df2026569e03503a67ded2 to your computer and use it in GitHub Desktop.
jPOS Systemd install script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This install script must be run as root" 1>&2 | |
exit 1 | |
fi | |
id -u jpos &>/dev/null || useradd --no-create-home -s /bin/false jpos | |
umask 027 && mkdir -p /opt/jpos | |
chown -R jpos.jpos /opt/jpos | |
chmod 2750 /opt/jpos | |
cat > /etc/systemd/system/jpos.service <<! | |
[Unit] | |
Description=jPOS System | |
[Service] | |
User=jpos | |
ExecStart=/opt/jpos/bin/q2 | |
RestartSec=10 | |
Restart=always | |
SuccessExitStatus=143 | |
[Install] | |
WantedBy=multi-user.target | |
! | |
/usr/bin/systemctl enable jpos | |
# /usr/bin/systemctl start jpos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment