mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
prise en charge systemd
This commit is contained in:
parent
524d2c3e96
commit
13f6168f6c
4 changed files with 21 additions and 11 deletions
|
@ -10,7 +10,7 @@
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
dir="YHDIR"
|
dir="YHDIR"
|
||||||
cmd="php daemon.php YHURL 8080"
|
cmd="php daemon.php https://YHURL 8080"
|
||||||
user="www-data"
|
user="www-data"
|
||||||
|
|
||||||
name=`basename $0`
|
name=`basename $0`
|
||||||
|
|
|
@ -5,8 +5,8 @@ After=nginx.service network.target local-fs.target
|
||||||
[Service]
|
[Service]
|
||||||
User=www-data
|
User=www-data
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/php daemon.php https://localhost/movim/ 8080
|
ExecStart=/usr/bin/php daemon.php https://YHURL 8080
|
||||||
WorkingDirectory=/usr/share/movim/
|
WorkingDirectory=YHDIR
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -48,13 +48,20 @@ sudo sed -i "s/yhdb/$db_user/g" $final_path/config/db.inc.php
|
||||||
sudo su -c "cd $final_path && php mud.php db set" -s /bin/sh www-data
|
sudo su -c "cd $final_path && php mud.php db set" -s /bin/sh www-data
|
||||||
sudo yunohost app addaccess movim -u $admin
|
sudo yunohost app addaccess movim -u $admin
|
||||||
|
|
||||||
# Copy init script if Wheezy
|
# Copy init script or systemd service
|
||||||
sudo cp ../conf/movim.init /etc/init.d/movim
|
sudo sed -i "s@YHURL@$domain$path@g" ../conf/movim.{service,init}
|
||||||
sudo sed -i "s@YHURL@$domain$path@g" /etc/init.d/movim
|
sudo sed -i "s@YHDIR@$final_path@g" ../conf/movim.{service,init}
|
||||||
sudo sed -i "s@YHDIR@$final_path@g" /etc/init.d/movim
|
if [ `pgrep -ox systemd` = "1" ];
|
||||||
|
then
|
||||||
# Copy systemd service if Jessie
|
sudo cp ../conf/movim.service /usr/lib/systemd/system/
|
||||||
# todo
|
sudo systemctl enable movim.service
|
||||||
|
sudo systemctl start movim.service
|
||||||
|
else
|
||||||
|
sudo cp ../conf/movim.init /etc/init.d/movim
|
||||||
|
sudo chmod 755 /etc/init.d/movim
|
||||||
|
sudo update-rc.d movim defaults
|
||||||
|
sudo /etc/init.d/movim start
|
||||||
|
fi
|
||||||
|
|
||||||
# Nginx configuration
|
# Nginx configuration
|
||||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
|
|
|
@ -12,8 +12,11 @@ sudo rm -f /etc/nginx/conf.d/$domain.d/movim.conf
|
||||||
|
|
||||||
#REMOVE INIT
|
#REMOVE INIT
|
||||||
sudo /etc/init.d/movim stop
|
sudo /etc/init.d/movim stop
|
||||||
sudo service movim stop
|
sudo systemctl stop movim
|
||||||
|
sudo systemctl disable movim
|
||||||
|
sudo update-rc.d -f movim remove
|
||||||
sudo rm /etc/init.d/movim
|
sudo rm /etc/init.d/movim
|
||||||
|
sudo rm /lib/systemd/system/movim.service
|
||||||
|
|
||||||
# Restarting services
|
# Restarting services
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
Loading…
Add table
Reference in a new issue