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]
|
||||
Description=Movim daemon
|
||||
Description=Movim daemon (__APP__)
|
||||
After=nginx.service network.target local-fs.target mysql.service
|
||||
|
||||
[Service]
|
||||
User=movim
|
||||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=/usr/bin/php daemon.php start --url=https://YHURL --port=YHPORT
|
||||
WorkingDirectory=YHDIR
|
||||
StandardOutput=syslog
|
||||
SyslogIdentifier=movim
|
||||
PIDFile=/run/movim.pid
|
||||
SyslogIdentifier=__APP__
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -182,15 +182,10 @@ exec_cmd php mud.php config --loglevel=1 \
|
|||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
# Copy init script or systemd service
|
||||
ynh_replace_string "YHURL" "${domain}${path_url}" ../conf/movim.service
|
||||
ynh_replace_string "YHDIR" "${final_path}" ../conf/movim.service
|
||||
ynh_replace_string "YHPORT" "${port}" ../conf/movim.service
|
||||
|
||||
cp ../conf/movim.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable movim.service
|
||||
systemctl start movim.service
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__URL__" "${domain}${path_url}" ../conf/systemd.service
|
||||
ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -38,11 +38,8 @@ ynh_remove_fpm_config
|
|||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
|
||||
service movim stop
|
||||
|
||||
systemctl --quiet disable movim.service
|
||||
ynh_secure_remove /lib/systemd/system/movim.service
|
||||
systemctl --quiet daemon-reload
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
|
|
|
@ -167,13 +167,10 @@ fi
|
|||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "YHURL" "${domain}${path_url}" ../conf/movim.service
|
||||
ynh_replace_string "YHDIR" "${final_path}" ../conf/movim.service
|
||||
ynh_replace_string "YHPORT" "${port}" ../conf/movim.service
|
||||
|
||||
ynh_secure_remove /lib/systemd/system/movim.service
|
||||
cp ../conf/movim.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__URL__" "${domain}${path_url}" ../conf/systemd.service
|
||||
ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# RELOAD SERVICES
|
||||
|
|
Loading…
Add table
Reference in a new issue