0

I deleted /etc/sv/<service>/log/current while this service was running and wanted to get a clean set of logs. However, when I did sudo service <service> restart, I saw that the current file was not re-created and I can't find where the new logs are going to. I then tried to make the file myself, and even gave the loosest write permission and saw that the file still is not being written to. Here's the ls -la of this directory(after I created the current file):

-rwxr--r-- 1 root root   92989 Sep 26 18:08 @400000005d8cfea82484f9e4.s
-rwxr--r-- 1 root root  353827 Sep 26 19:08 @400000005d8d0cb826d2f50c.s
-rwxr--r-- 1 root root  272084 Sep 26 19:45 @400000005d8d1ac8286c4a1c.s
-rwxr--r-- 1 root root  332117 Sep 26 21:00 @400000005d8d28d82f65f304.s
-rwxr--r-- 1 root root 1678531 Sep 26 22:08 @400000005d8d36e8308de4bc.s
-rwxr--r-- 1 root root 2143833 Sep 26 23:08 @400000005d8d44f831d170dc.s
-rwxr--r-- 1 root root 1549498 Sep 27 00:08 @400000005d8d5308332767d4.s
-rw-r--r-- 1 root root      33 Jan 31  2019 config
-rwxrwxrwx 1 root root       0 Sep 27 00:43 current
-rw------- 1 root root       0 Jan 31  2019 lock
drwxr-xr-x 2 root root    4096 Jan 31  2019 main
-rwxr-xr-x 1 root root      40 Jan 31  2019 run
drwx------ 2 root root    4096 Feb 21  2019 supervise

What can I do to bring back the current log and restart the log rotation on this service?

ps auxf gives me this particular line that seems interesting:

root      1269  0.0  0.0    176    44 ?        Ss   Feb21   0:17  \_ runsv <service>
root      1272  0.0  0.0    200    56 ?        S    Feb21  15:41  |   \_ svlogd -b 2048 -l 2000 .
root     29245  0.0  3.9 503232 299256 ?       Sl   00:55   0:22  |   \_ /usr/bin/python3 <some service>

I can see the log subservice here, but I'm not sure what command I can use to restart that subservice itself.

0

The log file (usually) gets written by the log sub-service, not the main service. You need to restart the log sub-service in order for it to close the file it's writing to and re-open it.

2
  • Hi, thank you for your answer! how would I restart a particular subservice? I have updated in my question the exact subservice you're talking about – OneRaynyDay Sep 27 '19 at 17:13
  • I have no idea, I don't use runit; sv restart /etc/sv/<service>/log would probably do it. Worst case, just whack the svlogd process and the supervisor should automagically restart it. – womble Sep 28 '19 at 3:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.