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

OpenRC service and support for more inits #368

Merged
merged 29 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f8fb6c7
openrc service
Cavernosa May 17, 2022
dafd57b
Update readme.md
Cavernosa May 17, 2022
376c528
Update ly-openrc
Cavernosa May 17, 2022
f424833
openrc service
Cavernosa May 17, 2022
0227e1b
Update makefile
Cavernosa May 17, 2022
20764d3
Update readme.md
Cavernosa May 17, 2022
fa40a6f
Update makefile
Cavernosa May 17, 2022
f45197c
fixed spelling
FordJ2 May 17, 2022
f964d09
Merge pull request #1 from wncry/patch-1
Cavernosa May 17, 2022
ccfb843
Merge branch 'master' into master
Cavernosa Jun 7, 2022
f05252e
OpenRC script
Jul 7, 2022
d5db6b8
Fix respawn period typo
Jul 8, 2022
d94132e
Fixed process locking of service
Jul 8, 2022
103241e
Added tty pull from conf file.
Jul 8, 2022
72c10f5
Small typo
MadcowOG Jul 8, 2022
86e13df
Small typo
MadcowOG Jul 8, 2022
7ba8b88
Added tty to TTY var.
Jul 8, 2022
cf3a87c
Fixes
Cavernosa Jul 9, 2022
b54f87e
Merge pull request #2 from fairyglade/master
Cavernosa Jul 9, 2022
2bd7573
Merge pull request #1 from Cavernosa/patch-2
MadcowOG Jul 11, 2022
988c750
Update ly-openrc
Cavernosa Jul 12, 2022
33041d2
Delete ly-openrc
Cavernosa Jul 12, 2022
2ac156f
Merge pull request #3 from MadcowOG/openrc
Cavernosa Jul 12, 2022
3a44a8f
Update readme.md
Cavernosa Jul 12, 2022
fc69b40
independent install for each service, and documentation to accomodate.
Jul 12, 2022
fbcceb4
Oops removed service install from install.
Jul 16, 2022
2335ab3
Merge pull request #4 from MadcowOG/make-services
Cavernosa Jul 16, 2022
3641a6b
Fix error, TTY was printing tty'2' instead of tty2
Cavernosa Jul 16, 2022
e38a75b
Merge branch 'master' into master
Cavernosa Aug 7, 2022
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
15 changes: 11 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,42 @@ leakgrind: $(BIND)/$(NAME)
@less valgrind.log

install: $(BIND)/$(NAME)
@echo "installing"
@echo "installing ly"
@install -dZ ${DESTDIR}/etc/ly
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
@install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly
@install -DZ $(RESD)/xsetup.sh -t $(DATADIR)
@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

installnoconf: $(BIND)/$(NAME)
@echo "installing without the configuration file"
@echo "installing ly without the configuration file"
@install -dZ ${DESTDIR}/etc/ly
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
@install -DZ $(RESD)/xsetup.sh -t $(DATADIR)
@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

installsystemd:
@echo "installing systemd service"
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system

installopenrc:
@echo "installing openrc service"
@install -DZ $(RESD)/ly-openrc -m 755 -T ${DESTDIR}/etc/init.d/${NAME}

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 -f ${DESTDIR}/etc/init.d/${NAME}

clean:
@echo "cleaning"
Expand Down
23 changes: 22 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ or a terminal emulator (but desktop environments won't start)

Install Ly and the provided systemd service file
```
# make install
# make install installsystemd
```

Enable the service
Expand All @@ -90,6 +90,27 @@ disable getty on Ly's tty to prevent "login" from spawning on top of it
# systemctl disable getty@tty2.service
```

### OpenRC

Clone, compile and test.

Install Ly and the provided OpenRC service
```
# make install installopenrc
```

Enable the service
```
# rc-update add ly
```

You can edit which tty Ly will start on by editing the `tty` option in the configuration file.

If you choose a tty that already has a login/getty running (has a basic login prompt), then you have to disable the getty so it doesn't respawn on top of ly
```
# rc-update del agetty.tty2
```

## Arch Linux Installation
From [AUR](https://aur.archlinux.org/packages/ly):
```
Expand Down
38 changes: 38 additions & 0 deletions res/ly-openrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/sbin/openrc-run

name="ly"
description="TUI Display Manager"

## Supervisor daemon
supervisor=supervise-daemon
respawn_period=60
pidfile=/run/"${RC_SVCNAME}.pid"

## Check for getty or agetty
if [ -x /sbin/getty ] || [ -x /bin/getty ];
then
# busybox
commandB="/sbin/getty"
elif [ -x /sbin/agetty ] || [ -x /bin/agetty ];
then
# util-linux
commandUL="/sbin/agetty"
fi

## Get the tty from the conf file
CONFTTY=$(cat /etc/ly/config.ini | sed -n 's/^tty.*=[^1-9]*// p')

## The execution vars
# If CONFTTY is empty then default to 2
TTY="tty${CONFTTY:-2}"
TERM=linux
BAUD=38400
# If we don't have getty then we should have agetty
command=${commandB:-$commandUL}
command_args_foreground="-nl /usr/bin/ly $TTY $BAUD $TERM"

depend() {
after agetty
provide display-manager
want elogind
}