refactor: improve installer code
- Refactor installer code for better readability and maintainability. - Move `dagu_server.vsh` to `examples/virt/daguserver/dagu_server.vsh`. - Remove unnecessary `println` statements. - Improve error handling in `zinit_installer_actions.v`. - Update `zinit_installer_actions.v` startup type to systemd. - Refactor several factory functions.
This commit is contained in:
@@ -222,7 +222,7 @@ pub fn (mut sm StartupManager) delete(name string) ! {
|
||||
}
|
||||
}
|
||||
else {
|
||||
panic('to implement, startup manager only support screen & systemd for now ${mycat}')
|
||||
panic('to implement, startup manager only support screen & systemd for now ${sm.cat}')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ pub fn (mut sm StartupManager) status(name string) !ProcessStatus {
|
||||
}
|
||||
}
|
||||
else {
|
||||
panic('to implement, startup manager only support screen & systemd for now ${mycat}')
|
||||
panic('to implement, startup manager only support screen & systemd for now ${sm.cat}')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ pub fn (mut sm StartupManager) output(name string) !string {
|
||||
return systemd.journalctl(service: name)!
|
||||
}
|
||||
else {
|
||||
panic('to implement, startup manager only support screen & systemd for now ${mycat}')
|
||||
panic('to implement, startup manager only support screen & systemd for now ${sm.cat}')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ pub fn (mut sm StartupManager) exists(name string) !bool {
|
||||
return zinitfactory.exists(name)
|
||||
}
|
||||
else {
|
||||
panic('to implement. startup manager only support screen & systemd for now ${mycat}')
|
||||
panic('to implement. startup manager only support screen & systemd for now ${sm.cat}')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ pub fn (mut sm StartupManager) list() ![]string {
|
||||
return zinitfactory.names()
|
||||
}
|
||||
else {
|
||||
panic('to implement. startup manager only support screen & systemd for now: ${mycat}')
|
||||
panic('to implement. startup manager only support screen & systemd for now: ${sm.cat}')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,6 @@ pub fn (mut self SystemdProcess) write() ! {
|
||||
|
||||
servicecontent := $tmpl('templates/service.yaml')
|
||||
|
||||
println(self)
|
||||
println(servicecontent)
|
||||
|
||||
p.write(servicecontent)!
|
||||
}
|
||||
|
||||
@@ -54,6 +51,7 @@ pub fn (mut self SystemdProcess) start() ! {
|
||||
|
||||
_ = osal.execute_silent(cmd)!
|
||||
self.refresh()!
|
||||
console.print_header('started systemd process: ${self.name}')
|
||||
}
|
||||
|
||||
// get status from system
|
||||
|
||||
Reference in New Issue
Block a user