(Grav GitSync) Automatic Commit from tanshu
This commit is contained in:
parent
c8b71264e7
commit
1f606e838c
@ -30,4 +30,20 @@ cd /home/tanshu/webapps/warden
|
|||||||
nohup env RACK_ENV=production bundle exec rackup -p $PORT config.ru > /dev/null 2>&1 &
|
nohup env RACK_ENV=production bundle exec rackup -p $PORT config.ru > /dev/null 2>&1 &
|
||||||
sleep 3
|
sleep 3
|
||||||
pgrep -f "ruby2.4 /home/tanshu/gems/bin/rackup -p $PORT config.ru" > /home/tanshu/webapps/warden/run/ruby.pid
|
pgrep -f "ruby2.4 /home/tanshu/gems/bin/rackup -p $PORT config.ru" > /home/tanshu/webapps/warden/run/ruby.pid
|
||||||
|
```
|
||||||
|
3.2 `Stop` script where `$PORT` is the port of the custom webapp
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
/usr/bin/pkill -f "ruby2.4 /home/tanshu/gems/bin/rackup -p $PORT config.ru" && rm -f /home/tanshu/webapps/warden/run/ruby.pid
|
||||||
|
```
|
||||||
|
3.3 `Restart` script
|
||||||
|
``sh
|
||||||
|
#!/bin/bash
|
||||||
|
$HOME/webapps/warden/bin/stop
|
||||||
|
sleep 3
|
||||||
|
$HOME/webapps/warden/bin/start
|
||||||
|
```
|
||||||
|
3.4 Edit crontab using `export VISUAL=nano; crontab -e` and add the following line
|
||||||
|
```sh
|
||||||
|
*/20 * * * * ~/webapps/warden/bin/start
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user