Skip to content

Instantly share code, notes, and snippets.

@dropofwill
Last active August 29, 2015 14:20
Show Gist options
  • Save dropofwill/21af80591041e28b02f8 to your computer and use it in GitHub Desktop.
Save dropofwill/21af80591041e28b02f8 to your computer and use it in GitHub Desktop.
A sample Upstart and System.d script
[Unit]
Description=Custom Start Up Service
[Service]
ExecStartPre=/bin/mkdir -p /var/log/customprocess
ExecStartPre=/bin/touch /var/log/customprocess/custom.log
ExecStart=/var/custom_service/our_service.sh
[Install]
WantedBy=multi-user.target
description "Custom Start up"
start on runlevel [2345]
stop on runlevel [!2345]
pre-start script
mkdir -p /var/log/customprocess
touch /var/log/customprocess/cusom.log
end script
script
echo `date` >> /var/log/customprocess/custom.log
end script
[Unit]
Description=Custom Start Up Service
[Service]
ExecStartPre=/bin/mkdir -p /var/log/customprocess
ExecStartPre=/bin/touch /var/log/customprocess/custom.log
ExecStart=/var/custom_service/our_service.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
date >> /var/log/customprocess/custom.log;
sleep 3h;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment