Created
March 25, 2019 02:25
-
-
Save aadityabhatia/e9a5715441331d43ef90aa3d0ac380b9 to your computer and use it in GitHub Desktop.
systemd service: preseed server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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