Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up runit service scripts #479

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ installopenrc:

installrunit:
@echo "installing runit service"
@install -dZ ${DESTDIR}/etc/sv/ly-runit-service
@install -DZ $(RESD)/ly-runit-service/* -t ${DESTDIR}/etc/sv/ly

uninstall:
Expand All @@ -111,6 +110,7 @@ uninstall:
@rm -f ${DESTDIR}/usr/lib/systemd/system/ly.service
@rm -f ${DESTDIR}/etc/pam.d/ly
@rm -f ${DESTDIR}/etc/init.d/${NAME}
@rm -rf ${DESTDIR}/etc/sv/ly

clean:
@echo "cleaning"
Expand Down
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ $ make
# ln -s /etc/sv/ly /var/service/
```

Disable your existing display manager service if need be e.g.:
By default, ly will run on tty2. To change the tty it must be set in `/etc/ly/config.ini`

You should as well disable your existing display manager service if needed, e.g.:

```
# rm /var/service/lxdm
```

If you are running on `tty2` (check your `/etc/ly/config.ini`) you can disable e.g. `agetty` running there:
The agetty service for the tty console where you are running ly should be disabled. For instance, if you are running ly on tty2 (that's the default, check your `/etc/ly/config.ini`) you should disable the agetty-tty2 service like this:

```
# rm /var/service/agetty-tty2
Expand Down
6 changes: 2 additions & 4 deletions res/ly-runit-service/conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ fi
BAUD_RATE=38400
TERM_NAME=linux

StandardInput=tty
TTYPath=/dev/tty2
TTYReset=yes
TTYVHangup=yes
auxtty=$(/bin/cat /etc/ly/config.ini 2>/dev/null 1| /bin/sed -n 's/\(^[[:space:]]*tty[[:space:]]*=[[:space:]]*\)\([[:digit:]][[:digit:]]*\)\(.*\)/\2/p')
TTY=tty${auxtty:-2}
5 changes: 3 additions & 2 deletions res/ly-runit-service/finish
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
tty=${PWD##*-}
exec utmpset -w $tty
[ -r conf ] && . ./conf

exec utmpset -w ${TTY}
4 changes: 1 addition & 3 deletions res/ly-runit-service/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

tty=${PWD##*-}

[ -r conf ] && . ./conf

if [ -x /sbin/getty -o -x /bin/getty ]; then
Expand All @@ -12,4 +10,4 @@ elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
GETTY=agetty
fi

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