From 497ab6eb32afe8169cedca2b9abc4c015089e0d5 Mon Sep 17 00:00:00 2001 From: anmol Date: Mon, 9 Nov 2020 22:00:01 +0530 Subject: [PATCH] service fix --- conf/systemd.service | 5 +++-- scripts/install | 4 ++-- scripts/remove | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 53a900e..a38c32b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,9 +3,10 @@ Description=__APP__ service After=network.target [Service] -User=noreply -ExecStart=/usr/bin/python3 __FINALPATH__/zeronet.py --ui_port __PORT__ --ui_host __DOMAIN__ --fileserver_port __FS_PORT__ --data_dir __DATADIR__/data --log_dir __DATADIR__/log +User=__APP__ +Group=__APP__ WorkingDirectory=__FINALPATH__ +ExecStart=/usr/bin/python3 ./zeronet.py --ui_port __PORT__ --ui_host __DOMAIN__ --fileserver_port __FS_PORT__ --data_dir __DATADIR__/data --log_dir __DATADIR__/log ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure diff --git a/scripts/install b/scripts/install index 11d1c0e..0a38620 100755 --- a/scripts/install +++ b/scripts/install @@ -110,7 +110,7 @@ ynh_script_progression --message="Installing dependencies..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -pip3 install msgpack-python gevent +pip3 install msgpack-python gevent #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -141,7 +141,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # SETUP SYSTEMD diff --git a/scripts/remove b/scripts/remove index dc8974e..5ff4037 100755 --- a/scripts/remove +++ b/scripts/remove @@ -49,7 +49,7 @@ ynh_remove_systemd_config ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies -pip3 uninstall msgpack-python gevent +pip3 uninstall -y msgpack-python gevent #================================================= # REMOVE APP MAIN DIR