Skip to content

Instantly share code, notes, and snippets.

@aadityabhatia
Created March 25, 2019 02:25
Show Gist options
  • Save aadityabhatia/e9a5715441331d43ef90aa3d0ac380b9 to your computer and use it in GitHub Desktop.
Save aadityabhatia/e9a5715441331d43ef90aa3d0ac380b9 to your computer and use it in GitHub Desktop.
systemd service: preseed server
[Unit]
Description=preseed file generator
Documentation=https://www.npmjs.com/package/preseed
Requires=network.target
After=network.target
AssertFileNotEmpty=/etc/preseed/config.json
[Service]
User=daemon
WorkingDirectory=/etc/preseed
ExecStartPre=+-/usr/bin/env npm install --global preseed
ExecStart=/usr/bin/env preseed -c config.json
[Install]
WantedBy=multi-user.target
## place this file at /etc/systemd/system/preseed.service
## install dependencies and create config files
# npm install --global preseed
# mkdir /etc/preseed
# cp /usr/local/lib/node_modules/preseed/config-example.json /etc/preseed/config.json
# chown -vR daemon /etc/preseed
## Update config file
# systemctl enable preseed
# systemctl start preseed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment