mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-10 09:46:40 +02:00
* Changes unauthorized-api exit code to 3 * Systemd will not restart on exit code 3
This commit is contained in:
parent
80675aa8b4
commit
f39621c2da
|
@ -8,6 +8,7 @@ Wants=network-online.target
|
|||
ExecStart=@prefix@/bin/onedrive --monitor
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
RestartPreventExitStatus=3
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
|
|
@ -10,6 +10,7 @@ User=%i
|
|||
Group=users
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
RestartPreventExitStatus=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -10,6 +10,8 @@ static import log;
|
|||
OneDriveApi oneDrive;
|
||||
ItemDatabase itemDb;
|
||||
|
||||
const int EXIT_UNAUTHORIZED = 3;
|
||||
|
||||
enum MONITOR_LOG_SILENT = 2;
|
||||
enum MONITOR_LOG_QUIET = 1;
|
||||
enum LOG_NORMAL = 0;
|
||||
|
@ -220,7 +222,7 @@ int main(string[] args)
|
|||
log.error("Could not initialize the OneDrive API");
|
||||
// workaround for segfault in std.net.curl.Curl.shutdown() on exit
|
||||
oneDrive.http.shutdown();
|
||||
return EXIT_FAILURE;
|
||||
return EXIT_UNAUTHORIZED;
|
||||
}
|
||||
|
||||
// if --synchronize or --monitor not passed in, exit & display help
|
||||
|
|
Loading…
Reference in a new issue