Skip to content

Commit

Permalink
Merge pull request #9 from dslm4515/stable-4.05
Browse files Browse the repository at this point in the history
Stable 4.05
Added missing `skel` directory. Fixed minor typos.
  • Loading branch information
dslm4515 authored Jun 19, 2021
2 parents 26cf213 + 3fd7c96 commit bb10543
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ s6-linux-init-maker -1 -f /etc/s6/skel -p "/bin:/sbin:/usr/bin" \
-D default -G "/sbin/agetty -L -8 tty1 115200" \
-c /etc/s6/base -t 2 -L -u root -U utmp /etc/s6/base
rm -rf /etc/s6/base/scripts
cp -r /etc/s6/scripts /etc/s6/base/scripts
# Copy scripts to bring NIC's up and down
install -v -m755 if* /sbin/
mkdir -pv /lib/services
Expand Down Expand Up @@ -106,22 +108,20 @@ Each interface should have configuration files in /etc/sysconfig. For example:
Examples are in net-configs

## Usage
To modify services for bootup:
```
# To add
s6-rc-bundle-update add default service1 service2
# To remove
s6-rc-bundle-update delete default service1 service2
```

Other useful commands:
To disable/enable services, modify the contents of `/etc/s6/sv/services/contents`. Then compile a new database to use for the next boot.

For example, to enable dbus service:
```
# Stop a service/bundle
s6-rc -d change service_name
# Start a service/bundle
s6-rc -u change service_name
# List all active services
s6-rc -a list
# List all services and bundles in the database
s6-rc-db list all
# Install dbus service scripts (dbus-srv, dbus-log) to /etc/s6/sv/
# Add dbus script to list of services to start at boot:
echo "dbus-srv" >> /etc/s6/sv/services/contents
# Compile a new database for boot
s6-rc-compile /etc/s6/db/new_db /etc/s6/sv
# Link new database to boot
mv -v /etc/s6/db/current /etc/s6/db/previous
ln -sv /etc/s6/db/new_db /etc/s6/db/current
```
9 changes: 9 additions & 0 deletions s6/skel/rc.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh -e

rl="$1"
shift

s6-rc-init -c /etc/s6/db/current /run/service

exec /etc/s6/base/scripts/runlevel "$rl"

3 changes: 3 additions & 0 deletions s6/skel/rc.shutdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

exec s6-rc -bda change
18 changes: 18 additions & 0 deletions s6/skel/rc.shutdown.final
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh -e

### Things to do *right before* the machine gets rebooted or
### powered off, at the very end of the shutdown sequence,
### when all the filesystems are unmounted.

### This is a last resort hook; normally nothing should be
### done here (your rc.shutdown script should have taken care
### of everything) and you should leave this script empty.

### Some distributions, however, may need to perform some
### actions after unmounting the filesystems: typically if
### an additional teardown action is required on a filesystem
### after unmounting it, or if the system needs to be
### pivot_rooted before it can be shut down, etc.

### Those are all exceptional cases. If you don't know for
### certain that you need to do something here, you don't.
5 changes: 5 additions & 0 deletions s6/skel/runlevel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; }

exec s6-rc -up change "$1"

0 comments on commit bb10543

Please sign in to comment.