mirror of https://github.com/nocturn9x/nimd.git
The shell is now spawned as a boot service
This commit is contained in:
parent
fd35755da5
commit
9289c455e3
|
@ -29,7 +29,6 @@ proc mainLoop*(logger: Logger) =
|
|||
logger.info("System initialization complete, going idle")
|
||||
logger.switchToFile()
|
||||
try:
|
||||
discard execShellCmd("/bin/login -f root") # TODO: Use a service
|
||||
while true:
|
||||
sleepSeconds(30)
|
||||
except:
|
||||
|
|
|
@ -292,7 +292,7 @@ proc startService(logger: Logger, service: Service) =
|
|||
var arguments = split.words
|
||||
let progName = arguments[0]
|
||||
arguments = arguments[1..^1]
|
||||
process = startProcess(progName, workingDir=service.workDir, args=arguments)
|
||||
process = startProcess(progName, workingDir=service.workDir, args=arguments, options={poParentStreams})
|
||||
if service.supervised and service.kind != Oneshot:
|
||||
var pid = posix.fork()
|
||||
if pid == 0:
|
||||
|
|
|
@ -59,10 +59,16 @@ proc addStuff =
|
|||
exec="/bin/true", supervised=true, restart=Always,
|
||||
restartDelay=5, runlevel=Boot, workDir="/", kind=Simple,
|
||||
depends=(@[newDependency(Other, errorer)]), provides=(@[]))
|
||||
var shell = newService(name="login", description="A simple login shell", kind=Simple,
|
||||
getCurrentDir(), runlevel=Boot, exec="/bin/login -f root",
|
||||
supervised=true, restart=Always, restartDelay=0, depends=(@[]), provides=(@[])
|
||||
)
|
||||
addService(errorer)
|
||||
addService(echoer)
|
||||
addService(exiter)
|
||||
addService(test)
|
||||
addService(shell)
|
||||
|
||||
|
||||
|
||||
proc main(logger: Logger, mountDisks: bool = true, fstab: string = "/etc/fstab", setHostname: bool = true, workerCount: int = 1) =
|
||||
|
|
Loading…
Reference in New Issue