add service file and minor changes

This commit is contained in:
Andrew Wang 2022-06-18 20:22:06 +00:00
parent 02fef450fd
commit c386fb2578
4 changed files with 21 additions and 5 deletions

View File

@ -91,6 +91,10 @@ type Config struct {
ZfssyncLogDir string `ini:"zfssync_logs_dir"`
// path to the unix socket for arthur to use for communication
SockPath string `ini:"sock_path"`
// // TODO: add dry run (default: false)
// DryRun bool `ini:"dry_run"`
// // TODO: add setting for verbosity (default: false)
// Verbose bool `ini:"verbose"`
}
type Repo struct {

View File

@ -1,5 +1,5 @@
ipv4_address = 129.97.134.129
ipv6_address = 2620:101:f000:4901:c5c::129
ipv4_address = 129.97.134.71
ipv6_address = 2620:101:f000:4901:c5c::f:1055
download_dir = /mirror/root
trace_dir = /home/mirror-go/merlin/trace
@ -12,8 +12,7 @@ zfssync_logs_dir = /home/mirror-go/merlin/logs-zfssync
sock_path = /mirror/merlin/run/merlin-go.sock
[CPAN]
; sync_type = csc-sync-standard
sync_type = csc-sync-dummy
sync_type = csc-sync-standard
frequency = twice-daily
local_dir = CPAN
rsync_host = cpan-rsync.perl.org

13
merlin/merlin-go.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Manages synchronization of mirrored projects
After=network.target
[Service]
ExecStart=/home/mirror/merlin-go/merlin /home/mirror/merlin-go/merlin-config.ini
WorkingDirectory=/home/mirror/merlin
User=mirror
Group=mirror
SyslogIdentifier=merlin-go
[Install]
WantedBy=multi-user.target

View File

@ -16,7 +16,7 @@ import (
// It returns a channel through which a Cmd will be sent once it has finished,
// or nil if it was unable to start a process.
func spawnProcess(repo *config.Repo, args []string) (ch <-chan *exec.Cmd) {
repo.Logger.Debug("Running the command: %v", args)
repo.Logger.Debug(fmt.Sprintf("Running the command: %v", args))
cmd := exec.Command(args[0], args[1:]...)
repo.Logger.Debug("Starting process")