diff options
Diffstat (limited to 'docs/Start automatically on boot.md')
-rw-r--r-- | docs/Start automatically on boot.md | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/docs/Start automatically on boot.md b/docs/Start automatically on boot.md index 055d932..963d50a 100644 --- a/docs/Start automatically on boot.md +++ b/docs/Start automatically on boot.md @@ -2,25 +2,47 @@ ```Git-Auto-Deploy``` can be automatically started at boot time using various techniques. Below you'll find a couple of suggested approaches with instructions. +The following instructions assumes that you are running ```Git-Auto-Deploy``` from a clone of this repository. In such a case, ```Git-Auto-Deploy``` is started by invoking ```python``` and referencing the ```gitautodeploy``` python module which is found in the cloned repository. Such a command can look like ```python /path/to/Git-Auto-Deploy/gitautodeploy --daemon-mode```. + +If you have used any of the alternative installation methods (install with pip or as a debian package), you will instead start ```Git-Auto-Deploy``` using a installed executable. ```Git-Auto-Deploy``` would then be started using a command like ```git-auto-deploy --daemon-mode``` instead. If you have installed ```Git-Auto-Deploy``` in this way, you will need to modify the paths and commands used in the instructions below. + ## Crontab The easiest way to configure your system to automatically start ```Git-Auto-Deploy``` after a reboot is using crontab. Open crontab in edit mode using ```crontab -e``` and add the following: -```@reboot /usr/bin/python /path/to/gitautodeploy --daemon-mode --quiet``` + @reboot /usr/bin/python /path/to/Git-Auto-Deploy/gitautodeploy --daemon-mode --quiet ## Debian and Sys-V like init system. -* Copy file ```initfiles/debianLSBInitScripts/gitautodeploy``` to ```/etc/init.d/``` -* Make it executable: ```chmod 755 /etc/init.d/gitautodeploy``` -* Also you need to make ```GitAutoDeploy.py``` executable (if it isn't already): ```chmod 755 GitAutoDeploy.py``` -* This init script assumes that you have ```GitAutoDeploy.py``` installed in ```/opt/Git-Auto-Deploy/``` and that the ```pidfilepath``` config option is set to ```/var/run/gitautodeploy.pid```. If this is not the case, edit the ```gitautodeploy``` init script and modify ```DAEMON```, ```PWD``` and ```PIDFILE```. -* Now you need to add the correct symbolic link to your specific runlevel dir to get the script executed on each start up. On Debian_Sys-V just do ```update-rc.d gitautodeploy defaults``` +Copy the sample init script into ```/etc/init.d/``` and make it executable. + + cp platforms/linux/initfiles/debianLSBInitScripts/git-auto-deploy /etc/init.d/ + chmod 755 /etc/init.d/git-auto-deploy + +The init script assumes that you have ```Git-Auto-Deploy``` installed in ```/opt/Git-Auto-Deploy/``` and that the ```pidfilepath``` config option is set to ```/var/run/git-auto-deploy.pid```. If this is not the case, edit the ```git-auto-deploy``` init script and modify ```DAEMON```, ```PWD``` and ```PIDFILE```. + +Now you need to add the correct symbolic link to your specific runlevel dir to get the script executed on each start up. On Debian_Sys-V just do; + + update-rc.d git-auto-deploy defaults ## Systemd -* Copy file ```initfiles/systemd/gitautodeploy.service``` to ```/etc/systemd/system``` -* Also you need to make ```GitAutoDeploy.py``` executable (if it isn't already): ```chmod 755 GitAutoDeploy.py``` -* And also you need to create the user and the group ```www-data``` if those not exists ```useradd -U www-data``` -* This init script assumes that you have ```GitAutoDeploy.py``` installed in ```/opt/Git-Auto-Deploy/```. If this is not the case, edit the ```gitautodeploy.service``` service file and modify ```ExecStart``` and ```WorkingDirectory```. -* now reload daemons ```systemctl daemon-reload``` -* Fire it up ```systemctl start gitautodeploy``` -* Make is start on system boot ```systemctl enable gitautodeploy``` +Copy the sample systemd service file ```git-auto-deploy.service``` into ```/etc/systemd/system```; + + cp platforms/linux/initfiles/systemd/git-auto-deploy.service /etc/systemd/system + +Create the user and group specified in git-auto-deploy.service (```www-data```) if those do not exist already. + + useradd -U www-data + +This init script assumes that you have ```Git-Auto-Deploy``` installed in ```/opt/Git-Auto-Deploy/```. If this is not the case, edit the ```git-auto-deploy.service``` service file and modify ```ExecStart``` and ```WorkingDirectory```. + +Now, reload daemons and fire ut up; + + systemctl daemon-reload + systemctl start git-auto-deploy + +Make is start automaticallt on system boot + + systemctl enable gitautodeploy + + |