-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
109 lines (79 loc) · 3.55 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
How To
!!!MAKE BACKUPS OF ALL MOVED OVERWRITTEN FILES OR ELSE!!!
!!sudo must be installed!!
!Updated for LFS 12.0
If you need to use for a lower version use the version in releases.
As root:
make install
You can change install locations in the Makefile, but be warned this may break stuff and leave your system unbootable!
You can use:
make install DESTDIR=/path/to/install
To stage the install for package managers.
This needs rewriting:
#####################
All files default to being in /etc/StartupServices, you can change this by setting /etc/service.rc, when running as a normal user the rc file is ~/.config/service.rc
Example:
SERVICEBASE=/home/keithhedger/StartupServices
SERVICERUNFOLDER=${SERVICEBASE}
You can run either as init or like I do as startup manager for my desktop I just use this line:
/home/keithhedger/StartupServices/runservices RUNALL &
in my xinitrc file
With this config file ~/.config/service.rc
SERVICEBASE=/home/keithhedger/StartupServices
SERVICERUNFOLDER=${SERVICEBASE}
#####################
Basic use:
servicermt HELP
Tue 11 Apr 16:07:26 BST 2017
Service run folder=/home/keithhedger/StartupServices
Service Data=/home/keithhedger/StartupServices/servicedata
Service File=services
Service Files=/home/keithhedger/StartupServices/servicefiles
Service run files=/home/keithhedger/StartupServices/servicerunfiles
Pid folder=/home/keithhedger/StartupServices/servicepids
Logs folder=/home/keithhedger/StartupServices/servicelogs
Format:
runservice RUN servicename
runservice RUNALL
runservice KILL servicename
runservice KILLALL
runservice LOGFILE servicename|ME
runservice RMLOG servicename
runservice RMALLLOGS
runservice PID servicename
runservice SHOWPIDS
Service file format:
COMMAND command to run
COMMAND second command to run
COMMAND ...
RUNTYPE once|keepalive|nocontrol|wait, default once
LOGFILE path, default /home/keithhedger/StartupServices/servicelogs/service.log
PIDFILE path, default /home/keithhedger/StartupServices/servicepids/service.pid
STATUS service
PIDFILECNT pidcnt, set the auto PIDFILECNT var manually
Pipe commands to /home/keithhedger/StartupServices/servicepipe
Service files can run more than one command and they can be set to respawn if they exit eg the aggety.service:
COMMAND setsid /sbin/agetty --noclear
RUNTYPE keepalive
RUNALL will run all service files ( *.service )
The main sercvice script is /etc/StartupServices/servicedata/services, by default though this can be changed via the config file, and can contain a mix of service files to run and normal commands eg:
/etc/StartupServices/startups/1
sleep 2
mkdir -vp "/run/StartupServices/servicerunfiles" "/run/StartupServices/servicelogs" "/run/StartupServices/servicepids"
mkfifo "/run/StartupServices/servicepipe"
/etc/StartupServices/startups/2
agetty.service tty2
agetty.service tty3
agetty.service tty4
Output will usually go to the console tty where the app has been started from but you can redirect the output to another tty with the ECHOTOPTY command, eg set output to from init current pty:
servicermt ECHOTOPTY $(tty)
servicermt LOGFILE ME
...
The (B)LFS sysv startup scripts can be used 'as is' by the usual method of placing them in /etc/rc.d/init.d and placing links in the aproppriate folder eg /etc/rc.d/rc2.d.
/etc/rc.d/rc1.d contains vital system startup files, any errors drop to a sulogin shell.
/etc/rc.d/rc2.d non essential services like gpm.
/etc/rc.d/rc3.d shutdown files
More documentaion to come!
A small boot movie is in the git repo ( "LFSDev.webm" ) which shows a basic lfs system booting using this init system.
BUGS etc.
kdhedger68713@gmail.com