Преглед на файлове

Remove some unused older references to Needs and Provides

master
Dashie der otter преди 2 години
родител
ревизия
39aa9e63ce
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755

+ 1
- 1
README.md Целия файл

@@ -10,7 +10,7 @@ lutrainit will do the following:
2. Remount the root filesystem[1]
3. Mount all other non-network filesystems and activate swap partitions
3. Start processes with config files in /etc/lutrainit/lutra.d/ after their dependencies
("Needs") are started. See `conf/` for a samples config.
("Requires") are started. See `conf/` for a samples config.
4. Start some TTY or anything other user-specified.
5. Kill running processes, unmount filesystems, and poweroff the system once that last
login session ends.

+ 6
- 9
SERVICES.md Целия файл

@@ -1,14 +1,15 @@
TODO: Full update of this file, currently outdated

# /etc/lutrainit/lutra.d/
## foo.service

Name: ServiceFoo
Description: Service Foo does lot of things and provides 'foobar'
Description: Service Foo does lot of things and provides 'foo'
Type: forking
PIDFile: /var/run/foo.pid
Startup: start_foo.bar
Shutdown: stop_foo.bar
Provides: foobar
## baz.service

@@ -16,8 +17,7 @@
Description: Baz runs after Foo and then needs 'foobar'
Type: simple
Provides: baz
Needs: foobar
Requires: foobar
Startup: baz --start
Shutdown: killall baz
@@ -26,8 +26,7 @@
- Name: name of the service, a-Z0-9 without spaces, - and _ allowed
- Description: One line description of the service
- Relations
- Provides: foo,bar
- Needs: bar,other
- Requires: bar,other
Separate multiples keywords with `,`. Only a-Z0-9 - and _ allowed
- Startup: One line command to start service
@@ -41,9 +40,7 @@
- simple: daemon doesn't fork by himself
- virtual: used only for dependencies ordering
Provides are mandatory, you can just put here the Name of the service.

Needs are used for relationship, like udev can only be started when loopback have been brought up.
Requires are used for relationship, like udev can only be started when loopback have been brought up.

## Default values
- Autostart: true

+ 11
- 10
conf/lutra.d/dbus.service Целия файл

@@ -1,12 +1,13 @@
Name: dbus
Description: system message bus
Type: forking
Autostart: true
[order]
WantedBy=basic.target
After=loopback.service

ExecPreStart: /usr/bin/dbus-uuidgen --ensure && mkdir /var/run/dbus && chown messagebus:messagebus /var/run/dbus
Startup: start-stop-daemon --start --quiet --pidfile /var/run/dbus/pid --exec /usr/bin/dbus-daemon -- --system
Shutdown: start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile /var/run/dbus/pid --user messagebus
PIDFile: /var/run/dbus/pid
[service]
Description=system message bus
Type=forking
Autostart=true

Provides: dbus
Requires: devfs
ExecPreStart=/usr/bin/dbus-uuidgen --ensure && mkdir /var/run/dbus && chown messagebus:messagebus /var/run/dbus
ExecStart=start-stop-daemon --start --quiet --pidfile /var/run/dbus/pid --exec /usr/bin/dbus-daemon -- --system
ExecStop=start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile /var/run/dbus/pid --user messagebus
PIDFile=/var/run/dbus/pid

+ 9
- 8
conf/lutra.d/lightdm.service Целия файл

@@ -1,10 +1,11 @@
Name: lightdm
Description: Light Display Manager
Type: forking
Autostart: false
[order]
WantedBy=multi-user.target

Startup: start-stop-daemon --start --quiet --pidfile /var/run/lightdm.pid --name lightdm --startas /usr/sbin/lightdm -- -d
Shutdown: start-stop-daemon --stop --quiet --pidfile /var/run/lightdm.pid --name lightdm --retry TERM/5/TERM/5
PIDFile: /var/run/lightdm.pid
[service]
Description=Light Display Managed
Type=forking
Autostart=false

Provides: lightdm
ExecStart=start-stop-daemon --start --quiet --pidfile /var/run/lightdm.pid --name lightdm --startas /usr/sbin/lightdm -- -d
ExecStop=start-stop-daemon --stop --quiet --pidfile /var/run/lightdm.pid --name lightdm --retry TERM/5/TERM/5
PIDFile=/var/run/lightdm.pid

+ 8
- 5
conf/lutra.d/loopback.service Целия файл

@@ -1,6 +1,9 @@
Name: loopback
Description: This is a simple script to bring up the loopback network interface device (127.0.0.1)
Type: oneshot
[order]
WantedBy=basic.target
After=mountall.service

Startup: ip link set up dev lo
Provides: localnet
[service]
Description=This is a simple script to bring up the loopback network interface device (127.0.0.1)
Type=oneshot
Autostart=true
ExecStart=ip link set up dev lo

+ 10
- 9
conf/lutra.d/lvm2-lvmetad.service Целия файл

@@ -1,11 +1,12 @@
Name: lvm2-lvmetad
Description: LVM2 metadata daemon
Type: forking
Autostart: true
[order]
WantedBy=disk.target
Requires=udev.service

ExecPreStart: mkdir -m 0700 -p /run/lvm
Startup: /sbin/lvmetad
PIDFile: /run/lvmetad.pid
[service]
Description=LVM2 metadata daemon
Type=forking
Autostart=true

Provides: lvm2-lvmetad
Needs: devfs
ExecPreStart=mkdir -m 0700 -p /run/lvm
ExecStart=/sbin/lvmetad
PIDFile=/run/lvmetad.pid

+ 10
- 9
conf/lutra.d/lvm2-lvpolld.service Целия файл

@@ -1,11 +1,12 @@
Name: lvm2-lvpolld
Description: LVM2 poll daemon
Type: forking
Autostart: true
[order]
WantedBy=disk.target
Requires=udev.service

ExecPreStart: mkdir -m 0700 -p /run/lvm
Startup: /sbin/lvmpolld -t 60
PIDFile: /run/lvmpolld.pid
[service]
Description=LVM2 poll daemon
Type=forking
Autostart=true

Provides: lvm2-lvpolld
Needs: devfs
ExecPreStart=mkdir -m 0700 -p /run/lvm
ExecStart=/sbin/lvmpolld -t 60
PIDFile=/run/lvmpolld.pid

+ 10
- 8
conf/lutra.d/lvm2.service Целия файл

@@ -1,10 +1,12 @@
Name: lvm2
Description: LVM2
Type: oneshot
Autostart: true
[order]
WantedBy=disk.target
After=lvm2-lvpolld.service,lvm2-lvmetad.service
Requires=udev.service

Startup: /sbin/lvm vgchange -aay --sysinit >/dev/null
PIDFile: /run/lvmpolld.pid
[service]
Description=LVM2
Type=oneshot
Autostart=true

Provides: lvm2, premount
Needs: lvm2-lvpolld, lvm2-lvmetad
ExecPreStart=mkdir -m 0700 -p /run/lvm
ExecStart=/sbin/lvm vgchange -aay --sysinit >/dev/null

+ 7
- 8
conf/lutra.d/mountall.service Целия файл

@@ -1,9 +1,8 @@
Name: mountall
Description: Mount all filesystems
Type: oneshot
Autostart: true
[order]
WantedBy=basic.target

Startup: mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev

Provides: mountall
Needs: premount
[service]
Description=Mount all filesystems
Type=oneshot
Autostart=true
ExecStart=mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev

+ 10
- 10
conf/lutra.d/network-manager.service Целия файл

@@ -1,12 +1,12 @@
Name: network-manager
Description: network connection manager
Type: forking
Autostart: false
[order]
WantedBy=network.target
#Requires=loopback.service,udev.service

PIDFile: /var/run/NetworkManager/NetworkManager.pid
[service]
Description=network connection manager
Type=forking
Autostart=true
PIDFile=/var/run/NetworkManager/NetworkManager.pid

Startup: start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager/NetworkManager.pid --exec /usr/sbin/NetworkManager
Shutdown: start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/NetworkManager/NetworkManager.pid --exec /usr/sbin/NetworkManager

Provides: network
Needs: devfs
ExecStart=start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager/NetworkManager.pid --exec /usr/sbin/NetworkManager
ExecStop=start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/NetworkManager/NetworkManager.pid --exec /usr/sbin/NetworkManager

+ 10
- 8
conf/lutra.d/network.eth0.service Целия файл

@@ -1,10 +1,12 @@
Name: network.eth0
Description: Brings up eth0 and setup networking
Type: oneshot
[order]
WantedBy=network.target
#Requires=loopback.service,udev.service

ExecPreStart: mkdir -p /run/network && chown root:netdev /run/network
Startup: ifup eth0
Shutdown: ifdown eth0
[service]
Description=Brings up eth0 and setup networking
Type=oneshot
Autostart=false

Provides: network
Needs: devfs
ExecPreStart: mkdir -p /run/network && chown root:netdev /run/network
ExecStart=ifup eth0
ExecStop=ifdown eth0

+ 8
- 6
conf/lutra.d/udev.service Целия файл

@@ -1,8 +1,10 @@
Name: udevd
Description: This is a sample config file to start udevd.
Type: forking
[order]
WantedBy=basic.target
After=loopback.service

Provides: devfs
[service]
Description=This is a sample config file to start udevd.
Type=forking
# udevd could also be "/lib/systemd/systemd-udevd" if systemd still installed
Startup: udevd --daemon && udevadm trigger --action=add --type=subsystems && udevadm trigger --action=add --type=devices && udevadm settle
Shutdown: udevadm control --exit
ExecStart=udevd --daemon && udevadm trigger --action=add --type=subsystems && udevadm trigger --action=add --type=devices && udevadm settle
ExecStop=udevadm control --exit

+ 9
- 8
conf/lutra.d/wpa_supplicant.service Целия файл

@@ -1,9 +1,10 @@
Name: wpa_supplicant
Description: This is a sample config file to start wpa_supplicant after udevd is started (which is needed to find the device wlan0.)
Type: unknown
Autostart: false
[order]
WantedBy=network.target
#Requires=loopback.service,udev.service

Provides: network
Needs: devfs
Startup: wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B && dhclient wlan0
Shutdown: killall wpa_supplicant
[service]
Autostart=false
Description=This is a sample config file to start wpa_supplicant after udevd is started (which is needed to find the device wlan0.)
Type=forking
ExecStart=wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B && dhclient wlan0
ExecStop=killall wpa_supplicant

+ 0
- 3
lutrainit/service.go Целия файл

@@ -111,9 +111,6 @@ func (c Command) String() string {
type StartupService struct {
Name ServiceName
AutoStart bool

Provides []ServiceType
Needs []ServiceType
}

// Service represents a struct with useful infos used for management of services

+ 1
- 1
lutrainit/sysinit_linux.go Целия файл

@@ -138,7 +138,7 @@ func sysinit(ctx *cli.Context) error {
ReloadConfig(MainConfig.StartedReexec, "/etc/lutrainit/", false)

if !MainConfig.StartedReexec {
// Start all services from StartupServices in the right Needs/Provide order
// Start all services from StartupServices in the right Requires order
StartServices()
}


+ 25
- 29
shared/ipc/ipc.go Целия файл

@@ -9,7 +9,7 @@ import (
// Version used with Version command of lutractl
// Returns server version to the client
type Version struct {
ServerVersion string
ServerVersion string
ServerBuildTime string
ServerBuildHash string
}
@@ -58,14 +58,14 @@ type SysStatus struct {

// AskStatus struct with limited service name or asking for all
type AskStatus struct {
Name string
All bool
Name string
All bool
}

// AnswerReload is a reload answer
type AnswerReload struct {
Err bool
ErrStr string
Err bool
ErrStr string
}

// LastAction represent the latest action done to the service
@@ -154,45 +154,41 @@ func (rs RunState) String() string {
}
}


// ServiceAction for start/stop/restart
type ServiceAction struct {
Name string
Action LastAction
Name string
Action LastAction
}

// ServiceActionAnswer is a service action answer
type ServiceActionAnswer struct {
Name string
Action LastAction
Err bool
ErrStr string
Name string
Action LastAction
Err bool
ErrStr string
}

// Service represents a struct with usefull infos used for management of services
type Service struct {
Name ServiceName
AutoStart bool

Provides []ServiceType
Needs []ServiceType
Name ServiceName
AutoStart bool

Description string // Currently not used
State RunState
Description string // Currently not used
State RunState

LastAction LastAction
LastActionAt int64 // Timestamp of the last action (UTC)
LastMessage string
LastKnownPID int
LastAction LastAction
LastActionAt int64 // Timestamp of the last action (UTC)
LastMessage string
LastKnownPID int

Type string // forking or simple
PIDFile string
Type string // forking or simple
PIDFile string

Startup Command
Shutdown Command
CheckAlive Command
Startup Command
Shutdown Command
CheckAlive Command

Deleted bool
Deleted bool
}

// IsCustASCII is a custom regexp checker for sanity

Loading…
Отказ
Запис