Repository navigation
Expand file tree
/
Copy pathconfig.h
More file actions
53 lines (45 loc) · 1.8 KB
/
Copy pathconfig.h
File metadata and controls
53 lines (45 loc) · 1.8 KB
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
#ifndef CRINIT_CONFIG_H
#define CRINIT_CONFIG_H
#define CRINIT_VERSION "2.0"
#define CRINIT_LOGFILE "/var/log/CRinit.log"
#define CRINIT_PIDFILE "/var/run/CRinit.pid"
#define DEFAULT_HOSTNAME "comrun"
// Service flags
#define SVC_RESTART 1 // Restart service when it exits
#define SVC_ONESHOT 2 // Run once, don't restart
#define SVC_ESSENTIAL 4 // Critical service, reboot if it dies
typedef struct {
const char *name;
const char *const *cmd;
int flags;
} Service;
// Services to start at boot.
// Order matters: services start sequentially in this order.
static const Service services[] = {
// System mounts (oneshot - run once)
{ "mount-proc", (const char *const[]){"mount", "-t", "proc", "proc", "/proc", NULL}, SVC_ONESHOT },
{ "mount-sys", (const char *const[]){"mount", "-t", "sysfs", "sysfs", "/sys", NULL}, SVC_ONESHOT },
{ "mount-dev", (const char *const[]){"mount", "-t", "devtmpfs", "devtmpfs", "/dev", NULL}, SVC_ONESHOT },
{ "sh", (const char *const[]){"/bin/sh", NULL}, SVC_ONESHOT },
// { "dbus", (const char *const[]){"dbus-daemon", "--system", "--fork", NULL}, SVC_RESTART },
// { "network", (const char *const[]){"NetworkManager", NULL}, SVC_RESTART },
// { "sshd", (const char *const[]){"sshd", "-D", NULL}, SVC_RESTART },
// { "login", (const char *const[]){"agetty", "tty1", "linux", NULL}, SVC_RESTART },
// Sentinel
{ NULL, NULL, 0 }
};
// Interactive shell command for 'crinit shell' and rescue mode
static const char *const shell_cmd[] = { "/bin/sh", NULL };
// Scripts to run after services start (in order)
static const char *const rc_local[] = {
"/etc/rc.local",
NULL
};
// Filesystems to unmount at shutdown (in reverse order)
static const char *const mount_points[] = {
"/sys",
"/proc",
"/dev",
NULL
};
#endif