Replace systemd service with runit service

This commit is contained in:
Пэйнт 2021-05-05 22:20:31 +07:00
parent 77f6958241
commit 28867c4e9c
6 changed files with 48 additions and 32 deletions

View File

@ -78,8 +78,9 @@ install: $(BIND)/$(NAME)
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
@install -dZ $(DATADIR)/lang
@install -DZ $(RESD)/lang/* -t $(DATADIR)/lang
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
@install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
@install -dZ ${DESTDIR}/etc/runit/sv/ly
@install -DZ $(RESD)/ly/* -t ${DESTDIR}/etc/runit/sv/ly
installnoconf: $(BIND)/$(NAME)
@echo "installing without the configuration file"
@ -89,16 +90,17 @@ installnoconf: $(BIND)/$(NAME)
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
@install -dZ $(DATADIR)/lang
@install -DZ $(RESD)/lang/* -t $(DATADIR)/lang
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
@install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
@install -dZ ${DESTDIR}/etc/runit/sv/ly
@install -DZ $(RESD)/ly/* -t ${DESTDIR}/etc/runit/sv/ly
uninstall:
@echo "uninstalling"
@rm -rf ${DESTDIR}/etc/ly
@rm -rf $(DATADIR)
@rm -f ${DESTDIR}/usr/bin/ly
@rm -f ${DESTDIR}/usr/lib/systemd/system/ly.service
@rm -f ${DESTDIR}/etc/pam.d/ly
@rm -rf ${DESTDIR}/etc/runit/sv/ly
clean:
@echo "cleaning"

View File

@ -1,8 +1,12 @@
# Ly - a TUI display manager
# Ly - a TUI display manager (for Artix Linux)
![Ly screenshot](https://user-images.githubusercontent.com/5473047/88958888-65efbf80-d2a1-11ea-8ae5-3f263bce9cce.png "Ly screenshot")
Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
## Patches added in fork
- runit service instead of systemd one by @qub1750ul
- service installed on default Artix service path (`/etc/runit/sv/`)
## Dependencies
- a C99 compiler (tested with tcc and gcc)
- a C standard library
@ -47,7 +51,7 @@ changing the source code won't be necessary :)
## Cloning and Compiling
Clone the repository
```
git clone https://github.com/nullgemm/ly.git
git clone https://github.com/xcession/ly-artix-runit.git
```
Fetch submodules
@ -60,26 +64,19 @@ Compile
make
```
Test in the configured tty (tty2 by default)
or a terminal emulator (but desktop environments won't start)
```
sudo make run
```
Install Ly and the provided systemd service file
Install Ly and the runit service file
```
sudo make install
```
Enable the service
You can disable getty-tty2
```
sudo systemctl enable ly.service
sudo unlink /run/runit/service/agetty-tty2
```
If you need to switch between ttys after Ly's start you also have to
disable getty on Ly's tty to prevent "login" from spawning on top of it
Now enable the runit service to make it spawn on startup
```
sudo systemctl disable getty@tty2.service
sudo ln -s /etc/runit/sv/ly/ /run/runit/service/
```
## Configuration

14
res/ly-runit-service/conf Executable file
View File

@ -0,0 +1,14 @@
if [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux specific settings
if [ "${tty}" = "tty1" ]; then
GETTY_ARGS="--noclear"
fi
fi
BAUD_RATE=38400
TERM_NAME=linux
StandardInput=tty
TTYPath=/dev/tty2
TTYReset=yes
TTYVHangup=yes

3
res/ly-runit-service/finish Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
tty=${PWD##*-}
exec utmpset -w $tty

15
res/ly-runit-service/run Executable file
View File

@ -0,0 +1,15 @@
#!/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 tty2 "${BAUD_RATE}" "${TERM_NAME}"

View File

@ -1,15 +0,0 @@
[Unit]
Description=TUI display manager
After=systemd-user-sessions.service plymouth-quit-wait.service
After=getty@tty2.service
[Service]
Type=idle
ExecStart=/usr/bin/ly
StandardInput=tty
TTYPath=/dev/tty2
TTYReset=yes
TTYVHangup=yes
[Install]
Alias=display-manager.service