Skip to content

Instantly share code, notes, and snippets.

@goliatone
Created November 19, 2015 17:12
Show Gist options
  • Select an option

  • Save goliatone/304d2853a316ad1ba331 to your computer and use it in GitHub Desktop.

Select an option

Save goliatone/304d2853a316ad1ba331 to your computer and use it in GitHub Desktop.
ubuntu init script that you can use to easily control a dat from Ubuntu
# ubuntu init script
# change YOUR_DAT_DIRECTORY
# save as /etc/init/dat.conf
# then run: sudo start dat
description 'serve a dat'
author 'Mathias Buus'
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
respawn
respawn limit 10 5
limit nofile 65535 65535
setuid ubuntu
setgid ubuntu
script
cd YOUR_DAT_DIRECTORY
dat serve --readonly # remove --readonly if you want to accept pushes
end script
@goliatone

Copy link
Copy Markdown
Author
/etc/init/dat.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment