make systemd service configurable via /etc/infnoise.conf
This commit is contained in:
@@ -290,8 +290,8 @@ int main(int argc, char **argv)
|
||||
xArg++;
|
||||
opts.serial = argv[xArg];
|
||||
if(opts.serial == NULL || !strcmp("",opts.serial)) {
|
||||
fputs("--serial without value\n", stderr);
|
||||
return 1;
|
||||
opts.serial = NULL;
|
||||
fputs("WARNING: --serial without value\n", stderr);
|
||||
}
|
||||
} else if(!strcmp(argv[xArg], "--daemon")) {
|
||||
opts.daemon = true;
|
||||
|
||||
@@ -14,6 +14,7 @@ which start the service when the Infinite Noise TRNG is connected and also stops
|
||||
- `infnoise.openrc`: OpenRC, ?
|
||||
- `infnoise.conf`: Upstart, tested in Ubuntu 14.04, 16.04 (requires upstart install)
|
||||
- `infnoise.service`: Systemd, works for CentOS, Ubuntu, Debian, ArchLinux
|
||||
- `infnoise.service.bin`: Same as infnoise.service, binary path = /usr/bin/
|
||||
- `infnoise.service.sbin`: Same as infnoise.service, binary path = /usr/sbin/
|
||||
- `infnoise.service.bin`: Same as infnoise.service, binary path = /usr/bin/ - uses config file from /etc/infnoise.conf
|
||||
- `infnoise.service.sbin`: Same as infnoise.service, binary path = /usr/sbin/ - uses config file from /etc/infnoise.conf
|
||||
- `infnoise.conf.systemd`: Config file for the systemd service, to set multiplier and serial number of device
|
||||
- `75-infnoise.rules`: udev rule to be used together with the systemd service
|
||||
|
||||
7
software/init_scripts/infnoise.conf.systemd
Normal file
7
software/init_scripts/infnoise.conf.systemd
Normal file
@@ -0,0 +1,7 @@
|
||||
# systemd configuration file for the Infinite Noise TRNG
|
||||
|
||||
INFNOISE_MULTIPLIER=1
|
||||
# keccak multiplier, default = 1
|
||||
|
||||
INFNOISE_SERIAL=
|
||||
# serial number of device, default: ""
|
||||
@@ -4,9 +4,10 @@ BindsTo=dev-infnoise.device
|
||||
After=dev-infnoise.device
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/infnoise.conf
|
||||
Type=forking
|
||||
WorkingDirectory=/tmp
|
||||
ExecStart=/usr/bin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid
|
||||
ExecStart=/usr/bin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid --multiplier ${INFNOISE_MULTIPLIER} --serial ${INFNOISE_SERIAL}
|
||||
User=root
|
||||
Group=root
|
||||
Restart=always
|
||||
|
||||
@@ -4,9 +4,10 @@ BindsTo=dev-infnoise.device
|
||||
After=dev-infnoise.device
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/infnoise.conf
|
||||
Type=forking
|
||||
WorkingDirectory=/tmp
|
||||
ExecStart=/usr/sbin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid
|
||||
ExecStart=/usr/sbin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid --multiplier ${INFNOISE_MULTIPLIER} --serial ${INFNOISE_SERIAL}
|
||||
User=root
|
||||
Group=root
|
||||
Restart=always
|
||||
|
||||
Reference in New Issue
Block a user