Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Self-made runit init script (Read 3122 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Self-made runit init script

Reply #15
I think, you'd better run
Code: [Select]
sudo /usr/bin/ly tty2 "${BAUD_RATE}" "${TERM_NAME}"
with properly set values
ARMtix

Re: Self-made runit init script

Reply #16
The thing is that if I simply run ly form terminal it works, but if I run this script https://raw.githubusercontent.com/drozdowsky/ly-void/master/res/ly-runit-service/run with sudo ./run I get the segmentation fault
I think that maybe the script is wrong cause there are variables like $GETTY_ARGS, $BAUD_RATE, and $TERM_NAME which are never declared or initialized. Could it be the reason?

Re: Self-made runit init script

Reply #17
Try
Code: [Select]
$ env
in your terminal, you'll see  what is set. The Void boot shell environment would have been different.

Re: Self-made runit init script

Reply #18
I think that maybe the script is wrong cause there are variables like $GETTY_ARGS, $BAUD_RATE, and $TERM_NAME which are never declared or initialized. Could it be the reason?
They should be specified in conf file (or exported in shell). Runit init scripts use BAUD_RATE=38400 and TERM_NAME=linux
ARMtix

Re: Self-made runit init script

Reply #19
I think, you'd better run
Code: [Select]
sudo /usr/bin/ly tty2 "${BAUD_RATE}" "${TERM_NAME}"
with properly set values
I tried to follow this by changing my script with that

Code: [Select]
#!/bin/sh

tty=${PWD##*-}

[ -r conf ] && . ./conf

if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi

#exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly tty7 "${BAUD_RATE}" "${TERM_NAME}"

exec /usr/bin/ly tty7 "${BAUD_RATE}˝ "${TERM_NAME}"

by setting BAUD_RATE to 38400 and TERM_NAME to "linux". Still nothing, tty1 starts by default and if I change to tty7 it gets in stuck.

Re: Self-made runit init script

Reply #20
I tried to follow this by changing my script with that

Code: [Select]
#!/bin/sh

tty=${PWD##*-}

[ -r conf ] && . ./conf

if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi

#exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly tty7 "${BAUD_RATE}" "${TERM_NAME}"

exec /usr/bin/ly tty7 "${BAUD_RATE}˝ "${TERM_NAME}"

by setting BAUD_RATE to 38400 and TERM_NAME to "linux". Still nothing, tty1 starts by default and if I change to tty7 it gets in stuck.
up

Re: Self-made runit init script

Reply #21
I tried to reproduce and get it working with:

/etc/runit/sv/ly/run
Code: [Select]
#!/bin/sh

tty=${PWD##*-}

[ -r conf ] && . ./conf

if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi

exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly tty7 "38400" "linux"

Edited /etc/ly/config.ini:
Code: [Select]
# tty in use
tty = 7

Then just enabled service
Code: [Select]
ln -s /etc/runit/sv/ly /run/runit/service
and reboot

Re: Self-made runit init script

Reply #22
I tried to reproduce and get it working with:

/etc/runit/sv/ly/run
Code: [Select]
#!/bin/sh

tty=${PWD##*-}

[ -r conf ] && . ./conf

if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi

exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly tty7 "38400" "linux"

Edited /etc/ly/config.ini:
Code: [Select]
# tty in use
tty = 7

Then just enabled service
Code: [Select]
ln -s /etc/runit/sv/ly /run/runit/service
and reboot
Thank you! It finally works! Meaning that it shows at startup, but if I type my password it doesn't log me in :'(
I select i3, my username, type my password, press enter, and it shows on top "logged out".... Why?

 

Re: Self-made runit init script

Reply #23
Thank you! It finally works! Meaning that it shows at startup, but if I type my password it doesn't log me in :'(
I select i3, my username, type my password, press enter, and it shows on top "logged out".... Why?
up