Open mailinglists35 opened 10 years ago
Logging is actually one of the things I definitely am including in pleaserun. It's not currently configurable, but the init scripts generated (and any other daemon service configs) should support a default log setting.
Check out here: https://github.com/jordansissel/pleaserun/blob/master/templates/sysv/lsb-3.1/init.sh#L60
This tells stdout to write to /var/log/NAME.log and stderr to write to /var/log/NAME.log
This is what we do for logging in upstart:
script
exec su -s /bin/bash \
-c "SERVICE_COMMAND" \
SERVICE_USER \
>> /var/log/SERVICE_NAME/SERVICE_TYPE-SERVICE_COUNT-stdout.log \
2>> /var/log/SERVICE_NAME/SERVICE_TYPE-SERVICE_COUNT-stderr.log
end script
Some notes:
setuid
would mean this isn't necessary.SERVICE_TYPE
and SERVICE_COUNT
are just things for our setupexport
calls right before the exec, allowing users to customize their application's environment.su
.
I found this https://gist.github.com/naholyr/4275302 and I was wondering if any functionality of it can be used in pleaserun. For example, the possibility of opening a log file is a missing feature in pleaserun.