76 lines
2.1 KiB
TypeScript
76 lines
2.1 KiB
TypeScript
|
export const templateReference = {
|
||
|
engines: {
|
||
|
node: {
|
||
|
service:
|
||
|
'# Generated by service-systemd on {{date}}\n' +
|
||
|
'[Unit]\n' +
|
||
|
'Description={description}\n' +
|
||
|
'Requires=network.target\n' +
|
||
|
'After=network.target\n' +
|
||
|
'\n' +
|
||
|
'[Service]\n' +
|
||
|
'Type=simple\n' +
|
||
|
'ExecStart={engine.bin} {engine.args} {app} {app.args}\n' +
|
||
|
'WorkingDirectory={cwd}\n' +
|
||
|
'Restart=on-failure\n' +
|
||
|
'{envs}\n' +
|
||
|
'LimitNOFILE=infinity\n' +
|
||
|
'LimitCORE=infinity\n' +
|
||
|
'StandardInput=null\n' +
|
||
|
'StandardOutput=syslog\n' +
|
||
|
'StandardError=syslog\n' +
|
||
|
'Restart=always\n' +
|
||
|
'SyslogIdentifier={name}\n' +
|
||
|
'PIDFile={pid}\n' +
|
||
|
'{user}\n' +
|
||
|
'{group}\n' +
|
||
|
'[Install]\n' +
|
||
|
'WantedBy=multi-user.target\n'
|
||
|
},
|
||
|
forever: {
|
||
|
service:
|
||
|
'# Generated by service-systemd on {date}\n' +
|
||
|
'[Unit]\n' +
|
||
|
'Description={description}\n' +
|
||
|
'Requires=network.target\n' +
|
||
|
'After=network.target\n' +
|
||
|
'\n' +
|
||
|
'[Service]\n' +
|
||
|
'Type=forking\n' +
|
||
|
'WorkingDirectory={cwd}\n' +
|
||
|
'{envs}\n' +
|
||
|
'ExecStart=/usr/local/bin/systemd-{name}-start\n' +
|
||
|
'ExecStop=/usr/local/bin/systemd-{name}-stop\n' +
|
||
|
'PIDFile={pid}\n' +
|
||
|
'{user}\n' +
|
||
|
'{group}\n' +
|
||
|
'[Install]\n' +
|
||
|
'WantedBy=multi-user.target\n',
|
||
|
start:
|
||
|
'#!/bin/bash\n' +
|
||
|
'{engine.bin} start ' +
|
||
|
'--pidFile {pid} ' +
|
||
|
'--uid {name} ' +
|
||
|
'--sourceDir {cwd} ' +
|
||
|
'-l {log} ' +
|
||
|
'-e {error} ' +
|
||
|
'--append --minUptime 5000 --spinSleepTime 2000 ' +
|
||
|
'{engine.args} ' +
|
||
|
'{app} {app.args}\n' +
|
||
|
'exit 0',
|
||
|
stop: '#!/bin/bash\n' + '{engine.bin} stop {name}\n' + 'exit 0'
|
||
|
}
|
||
|
},
|
||
|
logrotate:
|
||
|
'{log}\n{error} {\n' +
|
||
|
' {logrotate.frequency}\n' +
|
||
|
' rotate {logrotate.rotate}\n' +
|
||
|
' create\n' +
|
||
|
' missingok\n' +
|
||
|
' notifempty\n' +
|
||
|
' compress\n' +
|
||
|
' sharedscripts\n' +
|
||
|
// ' postrotate\n{restart}\n' +
|
||
|
' endscript\n}'
|
||
|
};
|