You are not logged in.
# Using OpenRC-init as pid=1
Inspired by this [https://laskarnix.org/devuan-migrate-fr … enrc-init/], I tried the following approach on Devuan.
## 1. Create an empty package to replace `sysvinit-core`
I created an empty package named `openrc-init` with the following control information:
```text
Conflicts: sysvinit-core
Replaces: sysvinit-core
Provides: sysvinit-core
Depends: openrc
```
After installing this package, `sysvinit-core` is removed from the system.
## 2. Use `openrc-init` as PID 1
Create a symlink that points `/sbin/init` to the `openrc-init` provided by OpenRC:
```sh
ln -sf /sbin/openrc-init /sbin/init
```
I also created the `poweroff` and `reboot` commands.
### `poweroff`
```sh
#!/bin/sh
exec /sbin/openrc-shutdown -p 0
```
### `reboot`
```sh
#!/bin/sh
exec /sbin/openrc-shutdown -r 0
```
## 3. Create and enable TTY services
Create `agetty` service links for `tty1` through `tty6`, then add them to the default runlevel:
```sh
for n in $(seq 1 6); do
ln -s agetty "agetty.tty$n"
rc-update add "agetty.tty$n" default
done
```
The system was able to boot normally. 👍
## Idea
As more and more Debian packages remove support for SysV service scripts in the future, it may be possible to build a Devuan distribution centered around OpenRC without extensively modifying or rebuilding upstream Debian packages.
The general approach could be:
- Reuse upstream Debian SysV service scripts whenever they are still available, reducing maintenance work;
- When a service no longer has a usable SysV script, obtain an appropriate OpenRC service script from Gentoo or Alpine Linux;
- Provide a compatibility layer or adaptation mechanism so that existing Debian packages can continue to work in an OpenRC environment;
- Minimize modifications to upstream packages in order to reduce long-term maintenance costs.
In this way, Devuan could preserve the Debian package ecosystem while gradually building a more complete and independent initialization and service-management system centered around OpenRC.
Offline
The "what" is easy, the "who" is hard.
Offline
I have currently packaged this and written a script to automate the operations described above. I also modified some services from the original `initscripts` to use the OpenRC format, mainly by adding `depend()` functions and virtual dependencies. They can run and work properly.
However, I cannot think of a good way to handle the following issue: if `initscripts` or other software is upgraded or updated, it may overwrite my scripts with the newer versions. Copying the many OpenRC service files from Alpine may also be difficult to manage.
Offline
if `initscripts` or other software is upgraded or updated, it may overwrite my scripts with the newer versions
I believe that this can be handled via dpkg-divert?
Offline
As more and more Debian packages remove support for SysV service scripts in the future
Isn't this problem already covered by the "orphan-sysvinit-scripts" package?
“Either the users control the program – or the program controls the users” Richard Stallman
Offline