Victor Walch Michnowicz

is a web application developer

Systemctl Gulp Watch Tasks June 29th, 2017

gulp-sass-watch.service

There are a few important bits in here:
[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

  1. Place gulp-sass-watch.service in /usr/lib/systemd/system/ directory.
  2. Run systemctl enable gulp-sass-watch to startup service on boot
  3. Run systemctl start gulp-sass-watch to startup the service immediately

blog comments powered by Disqus