Use non-templated systemd service
The previous setup was broken This commit also adds some code to check that the database connection is valid before it starts, as well as refactors the code that splits between starting and external or internal server.
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -124,14 +124,13 @@ fn main() -> anyhow::Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let server_connection =
|
||||
bootstrap_server_connection_and_drop_privileges(args.server_socket_path, args.config)?;
|
||||
let connection = bootstrap_server_connection_and_drop_privileges(
|
||||
args.server_socket_path,
|
||||
args.config,
|
||||
args.verbose,
|
||||
)?;
|
||||
|
||||
env_logger::Builder::new()
|
||||
.filter_level(args.verbose.log_level_filter())
|
||||
.init();
|
||||
|
||||
tokio_run_command(args.command, server_connection)?;
|
||||
tokio_run_command(args.command, connection)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user