Systemctl Gulp Watch Tasks June 29th, 2017
gulp-sass-watch.service
There are a few important bits in here:Restart
andRestartSec
will restart the gulp process if it failsUser
sets the user that runs the gulp process
[Unit] Description=gulp sass:watch After=network.target remote-fs.target nss-lookup.target [Service] Type=simple PIDFile=/var/run/gulp-sass-watch.pid Restart=always RestartSec=3 WorkingDirectory=/var/www/html ExecStartPre=/usr/bin/rm -f /var/run/gulp-sass-watch.pid ExecStart=/usr/bin/gulp sass:watch ExecStop=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true User=dev [Install] WantedBy=multi-user.target
Installation
- Place
gulp-sass-watch.service
in/usr/lib/systemd/system/
directory. - Run
systemctl enable gulp-sass-watch
to startup service on boot - Run
systemctl start gulp-sass-watch
to startup the service immediately
blog comments powered by Disqus