1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kresus_ynh.git synced 2024-09-03 19:36:10 +02:00

Accurate systemd service (and replacements)

This commit is contained in:
J. Fernando Lagrange 2017-07-18 05:29:03 +02:00
parent daa2e9bf09
commit aca8bca997
2 changed files with 7 additions and 6 deletions

View file

@ -3,8 +3,8 @@ Description=Kresus
After=syslog.target network.target
[Service]
WorkingDirectory=/home/yunohost.app/APP_TO_CHANGE
Environment=NODE_ENV=production
WorkingDirectory=YNH_HOME
Environment=NODE_ENV=production HOME=YNH_HOME KRESUS_URL_PREFIX=/$path
ExecStart=/usr/bin/node bin/kresus.js
Type=simple
Restart=always
@ -14,4 +14,4 @@ StandardError=inherit
SyslogIdentifier=kresus
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View file

@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
# Install dependencies
sudo apt-get update
sudo apt-get install nodejs-legacy npm python-weboob-core python-imaging -y -qq
# Build the app
src_path=/home/yunohost.app/$app
sudo git clone https://framagit.org/bnjbvr/kresus.git $src_path
@ -34,10 +34,11 @@ app=$YNH_APP_INSTANCE_NAME
# Setup service
systemd_service=../conf/kresus.service
sed -i "s@APP_TO_CHANGE@$app@g" $systemd_service
sed -i "s@YNH_HOME@$src_path@g" $systemd_service
sed -i "s@YNH_WWW_PATH@$path@g" $systemd_service
sudo cp $systemd_service /etc/systemd/system/$app.service
systemctl enable $app
systemctl start $app
# Reload services
sudo service nginx reload