linux - Cleaner way to restart daemontools services -
in our product, had created services using daemontools. 1 of service looks this,
/service/test/run /service/test/log/run (has multilog command log ./main dir) /service/test/log/main/..
all process , directories owned root user. there security requirement change this,
- service should run in non-root user.
- log main directory should readable user , groups.
for this, have change 'run' file under 'log' directory. need change permissions of 'main' directory under it.
note these files under '/service' owned test-1.0-0.rpm. when update rpm, overrides existing run file , got error this,
multilog: fatal: unable lock directory ./main: access denied
i know shouldn't override 'run' file @ run time. have planned follow these steps in rpm script %post section,
//stop service svc -d /service/test/log //moving main directory mv /service/test/log/main /service/test/log/main_old //updated run file has code create main limited permissions. //start service svc -u /service/test/log
in articles, suggested recreate 'lock' file under 'log/main'. there other cleaner way of doing without moving 'main' directory ? if not, safe go above steps ?
Comments
Post a Comment