Re: Runit questions

From: Andy Mender <andymenderunix_at_gmail.com>
Date: Sun, 16 Oct 2016 00:28:01 +0200

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.

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".
The same run scripts work on Gentoo, which makes it even more surprising.
Below the log/run script:
#!/bin/sh
exec chpst -u log svlogd -tt ./

Any ideas what's going on?

PS Earlier runsvdir was complaining that "log: user/group not found". I
created the "log" group, thinking it might help somehow.

Best regards,
Andy Mender

On 14 October 2016 at 00:22, Avery Payne <avery.p.payne_at_gmail.com> wrote:

>
> On Tue, Oct 11, 2016 at 3:09 PM, Andy Mender <andymenderunix_at_gmail.com>
> wrote:
>
>> Hello again,
>>
>> I'm rewriting some of the standard sysvinit and openrc scripts to ./run
>> scripts
>>
>
> I would look around a bit. There are little pockets of pre-written
> scripts out there, you just need to dig them up.
>
> Some of the scripts on smarden.org may have minor issues with the daemon
> flags they use, so if it doesn't work, go read the man page and compare the
> flags in the script to the flags for your installed daemon.
>
>
>> and I have some problems with dbus. I took the ./run script from Void
>> Linux
>> as the original runit documentation doesn't have an exemplary dbus script.
>> Whenever I check the status of dbus via "sv status dbus", I get the
>> following
>> error: "warning: dbus: unable to open supervise/ok: file does not exist".
>> This
>> makes no sense, as both /etc/sv/dbus/supervise/ and
>> /var/service/dbus/supervise/
>> contain the "ok" file. Below the run script from Void Linux:
>> #!/bin/sh
>> [ ! -d /run/dbus ] && install -m755 -g 22 -o 22 -d /run/dbus
>> exec dbus-daemon --system --nofork --nopidfile
>>
>
> Here is a hacked-up copy of my ./run script. Be sure to change the
> "messagebus" user name after the setuidgid to the proper daemon account for
> your installation. Sorry for the backslash, the word-wrap in the posting
> would otherwise kill any formatting.
>
>
> #!/bin/sh
> exec 2>&1
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>
> # must have a valid procfs
> mountpoint -q /proc/ || exit 1
>
> # create a unique identifier on each startup
> dbus-uuidgen --ensure || exit 1
>
> # start the service
> exec pgrphack setuidgid messagebus \
> dbus-daemon --nofork --system --nopidfile
>
>
>
>>
>> Not sure what's wrong and why this run script needs to contain so many
>> operands.
>>
>
> The daemon's runtime directory needs to exist before it is launched. The
> first line after the shebang basically does that.
>
Received on Sat Oct 15 2016 - 22:28:01 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC