Thank you for the links and the svlogd script. Great help indeed :). Best regards, Andy
On 16 Oct 2016 22:19, "Avery Payne" <avery.p.pa...@gmail.com> wrote: I hate using webmail. It always eats your formatting. The script shows up as a block of text in the mailing list because of this; just click the link for the project and look for the run-svlogd script. You'll find what you need there. On Sun, Oct 16, 2016 at 1:16 PM, Avery Payne <avery.p.pa...@gmail.com> wrote: > > > On Sat, Oct 15, 2016 at 3:28 PM, Andy Mender <andymenderu...@gmail.com> > wrote: > >> Hello everyone, >> >> I managed to solve some of my problems. It turned out that my terminal was >> being spammed >> with erroneous output, because I didn't add the "exec 2&>1" redirection to >> my ./run files. >> > > This behavior is fairly consistent among supervisors. The use of STDERR > typically is left to the administrator to decide; more commonly, it's > simply tied off into the STDOUT stream for ease of use. > > >> >> Another problem popped up on my Devuan box, though. I was trying to add a >> log directory with a ./run script inside to log dhcpcd per runit's design. >> However, runsvdir complaints that "exec: not found". >> > > This is probably a problem with your shell. The shebang specified might > point to an actual sh and not something like bash, ash, dash, etc. I don't > have a reference handy but I suspect that you are seeing failure messages > for "exec" because the shell doesn't support that built-in. > > If you encounter this, change the first line to /bin/bash or /bin/ash or > /bin/dash and see if that resolves the issue. > > >> The same run scripts work on Gentoo, which makes it even more surprising. >> > > Gentoo may be mapping /bin/sh to bash/ash/something else, but I don't > know. I would suggest finding out. > > >> Below the log/run script: >> #!/bin/sh >> exec chpst -u log svlogd -tt ./ >> > > I'll post a companion log script in a moment. > > >> PS Earlier runsvdir was complaining that "log: user/group not found". I >> created the "log" group, thinking it might help somehow. >> > > You shouldn't need to create the group normally, which may indicate a > separate issue. > > Try this run script in your ./svcdef/dbus/log directory. It's lifted > straight from the source at http://bitbucket.org/avery_pay > ne/supervision-scripts as the ./svcdef/.log/run-svlogd script. Please > note that you may need to change the group name after chown, and the shell > in the first line to meet your needs: > > #!/bin/shexec 2>&1# determine our parent's nameSVNAME=$( basename $( echo > `pwd` | sed 's/log//' ) )# bring up svlogd logging into a subdirectory that > has the parent's name.[ -d /var/log/$SVNAME ] || mkdir -p /var/log/$SVNAME ; > chown :adm /var/log/$SVNAME[ -d main ] || ln -s /var/log/$SVNAME mainexec > /usr/bin/svlogd -tt main > > If you are using Gentoo, I would recommend looking at Toki Clover's > implementation at https://github.com/tokiclover/supervision. > > I hope this helps. >