mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 02:18:00 +02:00
feat: add openrc support
This commit is contained in:
@@ -8,17 +8,21 @@ There's make scripts to automatically copy the service files to the proper locat
|
||||
The manuall steps for installation are:
|
||||
|
||||
## Systemd
|
||||
* Copy `systemd.service` to `/etc/systemd/system/lidm.service`.
|
||||
* Copy `systemd.service` to `/etc/systemd/system/lidm.service`
|
||||
* To enable it you can run `systemctl enable lidm`
|
||||
|
||||
## Dinit
|
||||
* Copy `dinit` to `/etc/dinit.d/lidm`.
|
||||
* To enable it, run `dinitctl enable lidm`.
|
||||
* Copy `dinit` to `/etc/dinit.d/lidm`
|
||||
* To enable it, run `dinitctl enable lidm`
|
||||
|
||||
## Runit
|
||||
* Copy `runit/` to `/etc/runit/sv/lidm/`.
|
||||
* Add the service with `ln -s /etc/runit/sv/lidm /run/runit/service`.
|
||||
* Copy `runit/` to `/etc/runit/sv/lidm/`
|
||||
* Add the service with `ln -s /etc/runit/sv/lidm /run/runit/service`
|
||||
* And to enable it `sv enable lidm`
|
||||
|
||||
## OpenRC
|
||||
* Copy `openrc` to `/etc/init.d/lidm`
|
||||
* Enable the service with `rc-update add lidm`
|
||||
|
||||
> [!WARNING]
|
||||
> Make sure to disable any other service that might run on tty7, such us lightdm or most display managers out there.
|
||||
|
31
assets/services/openrc
Executable file
31
assets/services/openrc
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/openrc-run
|
||||
description="start agetty on a terminal line"
|
||||
supervisor=supervise-daemon
|
||||
port=tty7
|
||||
respawn_period="${respawn_period:-60}"
|
||||
term_type="${term_type:-linux}"
|
||||
command=/sbin/agetty
|
||||
command_args_foreground="${agetty_options} ${port} ${baud} ${term_type} -nl /bin/lidm -o 7"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
after local
|
||||
keyword -prefix
|
||||
provide getty
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "$port" = "$RC_SVCNAME" ]; then
|
||||
eerror "${RC_SVCNAME} cannot be started directly. You must create"
|
||||
eerror "symbolic links to it for the ports you want to start"
|
||||
eerror "agetty on and add those to the appropriate runlevels."
|
||||
return 1
|
||||
else
|
||||
export EINFO_QUIET="${quiet:-yes}"
|
||||
fi
|
||||
}
|
||||
|
||||
stop_pre()
|
||||
{
|
||||
export EINFO_QUIET="${quiet:-yes}"
|
||||
}
|
Reference in New Issue
Block a user