Не могу запустить демона

У меня есть следующий файл в /etc/systemd/system/ip_mit_service.service

[Unit]
Description=service for mitigator
Requires=
After=

[Service]
PIDFile=/var/run/ip_mit_service.pid
ExecStartPre=/bin/rm -f /var/run/ip_mit_service.pid
ExecStart=/home/soc/go/src/ip_mit_service/ip_mit_service 
Restart=on-failure

[Install]
WantedBy=multi-user.target

Я не могу запустить демона, systemctl status ip_mit_service показывает

ip_mit_service.service - service for mitigator
     Loaded: loaded (/etc/systemd/system/ip_mit_service.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2024-07-06 17:03:09 MSK; 26min ago
    Process: 4241 ExecStartPre=/bin/rm -f /var/run/ip_mit_service.pid (code=exited, status=0/SUCCESS)
    Process: 4242 ExecStart=/home/soc/go/src/ip_mit_service/ip_mit_service (code=exited, status=2)
   Main PID: 4242 (code=exited, status=2)

июл 06 17:03:09 soc-is-ubuntu-desktop systemd[1]: ip_mit_service.service: Scheduled restart job, restart counter is at 5.
июл 06 17:03:09 soc-is-ubuntu-desktop systemd[1]: Stopped service for mitigator.
июл 06 17:03:09 soc-is-ubuntu-desktop systemd[1]: ip_mit_service.service: Start request repeated too quickly.
июл 06 17:03:09 soc-is-ubuntu-desktop systemd[1]: ip_mit_service.service: Failed with result 'exit-code'.
июл 06 17:03:09 soc-is-ubuntu-desktop systemd[1]: Failed to start service for mitigator.
~

В ответ на запрос journal -xe:

июл 06 19:16:16 soc-is-ubuntu-desktop systemd[1]: Stopped service for mitigator.
-- Subject: A stop job for unit ip_mit_service.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit ip_mit_service.service has finished.
-- 
-- The job identifier is 6605 and the job result is done.
июл 06 19:16:16 soc-is-ubuntu-desktop systemd[1]: ip_mit_service.service: Start request repeated too quickly.
июл 06 19:16:16 soc-is-ubuntu-desktop systemd[1]: ip_mit_service.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit ip_mit_service.service has entered the 'failed' state with result 'exit-code'.
июл 06 19:16:16 soc-is-ubuntu-desktop systemd[1]: Failed to start service for mitigator.
-- Subject: A start job for unit ip_mit_service.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit ip_mit_service.service has finished with a failure.
-- 
-- The job identifier is 6605 and the job result is failed.

Также я пробовал journalctl -u ip_mit_service, на что получил следующий вывод:

-- Logs begin at Sat 2023-12-09 20:22:35 MSK, end at Sat 2024-07-06 20:09:14 MSK. --
апр 20 12:03:25 soc-is-ubuntu-desktop systemd[1]: /etc/systemd/system/ip_mit_service.service:7: PIDFile= references a path below legacy directory /var/run/, updating /var/run/ip_mit_service.pid → /run/ip_mit_service.pid; please update the unit file accordingly.
апр 20 12:03:33 soc-is-ubuntu-desktop systemd[1]: Starting service for mitigator...
апр 20 12:03:33 soc-is-ubuntu-desktop systemd[1]: Started service for mitigator.
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]: 2024/04/20 12:03:33 conf.DBMS= sqlite
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]: 2024/04/20 12:03:33 /home/soc/go/src/mit_serv/records.txt
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]: 12:03:33.1247 ready; press ^C to exit
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  ┌───────────────────────────────────────────────────┐
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  │                   Fiber v2.51.0                   │
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  │               http://127.0.0.1:3000               │
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  │                                                   │
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  │ Handlers ............ 14  Processes ........... 1 │
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  │ Prefork ....... Disabled  PID .............. 6809 │
апр 20 12:03:33 soc-is-ubuntu-desktop ip_mit_service[6809]:  └───────────────────────────────────────────────────┘
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: panic: runtime error: invalid memory address or nil pointer dereference
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x55640e]
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: goroutine 7 [running]:
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: database/sql.(*Rows).closemuRUnlockIfHeldByScan(0xca80e0?)
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]:         /usr/local/go/src/database/sql/sql.go:3338 +0xe
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: database/sql.(*Rows).Next(0x0)
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]:         /usr/local/go/src/database/sql/sql.go:2986 +0x1c
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]: ip_mit_service/http_service.(*DBOutput).GetDBRecLong(0xc00010e000)
апр 20 12:08:17 soc-is-ubuntu-desktop ip_mit_service[6809]:         /home/soc/go/src/ip_mit_service/http_service/service.go:309 +0x430

При этом в моем проекте просто нет файла, указанного в логе, а именно /home/soc/go/src/ip_mit_service/http_service/service.go: !


Ответы (0 шт):