mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
Use systemd helpers
This commit is contained in:
parent
709d745b73
commit
094ed3a8a1
4 changed files with 15 additions and 26 deletions
|
@ -1,15 +1,15 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Movim daemon
|
Description=Movim daemon (__APP__)
|
||||||
After=nginx.service network.target local-fs.target mysql.service
|
After=nginx.service network.target local-fs.target mysql.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=movim
|
|
||||||
Type=simple
|
Type=simple
|
||||||
|
User=__APP__
|
||||||
|
Group=__APP__
|
||||||
|
WorkingDirectory=__FINALPATH__/
|
||||||
ExecStart=/usr/bin/php daemon.php start --url=https://YHURL --port=YHPORT
|
ExecStart=/usr/bin/php daemon.php start --url=https://YHURL --port=YHPORT
|
||||||
WorkingDirectory=YHDIR
|
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
SyslogIdentifier=movim
|
SyslogIdentifier=__APP__
|
||||||
PIDFile=/run/movim.pid
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -182,15 +182,10 @@ exec_cmd php mud.php config --loglevel=1 \
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Copy init script or systemd service
|
# Create a dedicated systemd config
|
||||||
ynh_replace_string "YHURL" "${domain}${path_url}" ../conf/movim.service
|
ynh_replace_string "__URL__" "${domain}${path_url}" ../conf/systemd.service
|
||||||
ynh_replace_string "YHDIR" "${final_path}" ../conf/movim.service
|
ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service
|
||||||
ynh_replace_string "YHPORT" "${port}" ../conf/movim.service
|
ynh_add_systemd_config
|
||||||
|
|
||||||
cp ../conf/movim.service /etc/systemd/system/
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl enable movim.service
|
|
||||||
systemctl start movim.service
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -38,11 +38,8 @@ ynh_remove_fpm_config
|
||||||
# STOP AND REMOVE SERVICE
|
# STOP AND REMOVE SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
service movim stop
|
# Remove the dedicated systemd config
|
||||||
|
ynh_remove_systemd_config
|
||||||
systemctl --quiet disable movim.service
|
|
||||||
ynh_secure_remove /lib/systemd/system/movim.service
|
|
||||||
systemctl --quiet daemon-reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
|
|
|
@ -167,13 +167,10 @@ fi
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_replace_string "YHURL" "${domain}${path_url}" ../conf/movim.service
|
# Create a dedicated systemd config
|
||||||
ynh_replace_string "YHDIR" "${final_path}" ../conf/movim.service
|
ynh_replace_string "__URL__" "${domain}${path_url}" ../conf/systemd.service
|
||||||
ynh_replace_string "YHPORT" "${port}" ../conf/movim.service
|
ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service
|
||||||
|
ynh_add_systemd_config
|
||||||
ynh_secure_remove /lib/systemd/system/movim.service
|
|
||||||
cp ../conf/movim.service /etc/systemd/system/
|
|
||||||
systemctl daemon-reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD SERVICES
|
# RELOAD SERVICES
|
||||||
|
|
Loading…
Add table
Reference in a new issue