@sergiusens @chipaca
(expanding on rant from irc)
17:38 bdx beating this nginx logging horse to death here
17:40 bdx I had great success with getting my logs to syslog via the snap logging proxy
17:40 bdx not sure the technical name for that mechanism
17:41 bdx a req came down the line that this application log to a separate file(s) and the logs end up in s3
17:41 bdx so I had to log to $SNAP_COMMON
17:41 bdx which works great until I try to setup logrotate
17:42 bdx I hit my head on a few things, but ended up getting logrotate in this working/broken state
17:43 bdx in short, the issue I seem to be having is that when logrotate goes to swap out the logfile, nginx needs a kick (reload) to start writing to the new logfile
The issue I’m experiencing is that, I’m not quite sure how to go about reloading nginx being that it is a process managed by the snap (see below).
17:44 bdx which brings me to the (logrotate) postrotate scripts
17:44 bdx which can be used to send signal or run a bin when your gets rotated and swapped out
17:45 bdx so my idea here was to create a wrapper command in my snap to facilitate running the nginx -s reload command
17:49 bdx here’s whats in my wrapper http://paste.ubuntu.com/26115750/
17:50 bdx the output I’m getting ^
17:50 bdx seems like the snap is preventing the process from being restarted
17:50 bdx nginx: [alert] kill(17878, 1) failed (1: Operation not permitted)
17:50 bdx I should probably write another forum post pertaining to this
17:51 bdx possibly my last one on logging wasn’t specific enough
17:51 bdx is this making sense?
17:51 bdx do I need to add more context somehow in a more proper write up?
Am I going about this the right way?
Possibly there is something else I can do to reload nginx (other then http://paste.ubuntu.com/26115750/)?
Thoughts?
thanks