mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-20 14:46:35 +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
|
ExecStart=@prefix@/bin/onedrive --monitor
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
RestartPreventExitStatus=3
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|
|
@ -10,6 +10,7 @@ User=%i
|
||||||
Group=users
|
Group=users
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
RestartPreventExitStatus=3
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -10,6 +10,8 @@ static import log;
|
||||||
OneDriveApi oneDrive;
|
OneDriveApi oneDrive;
|
||||||
ItemDatabase itemDb;
|
ItemDatabase itemDb;
|
||||||
|
|
||||||
|
const int EXIT_UNAUTHORIZED = 3;
|
||||||
|
|
||||||
enum MONITOR_LOG_SILENT = 2;
|
enum MONITOR_LOG_SILENT = 2;
|
||||||
enum MONITOR_LOG_QUIET = 1;
|
enum MONITOR_LOG_QUIET = 1;
|
||||||
enum LOG_NORMAL = 0;
|
enum LOG_NORMAL = 0;
|
||||||
|
@ -220,7 +222,7 @@ int main(string[] args)
|
||||||
log.error("Could not initialize the OneDrive API");
|
log.error("Could not initialize the OneDrive API");
|
||||||
// workaround for segfault in std.net.curl.Curl.shutdown() on exit
|
// workaround for segfault in std.net.curl.Curl.shutdown() on exit
|
||||||
oneDrive.http.shutdown();
|
oneDrive.http.shutdown();
|
||||||
return EXIT_FAILURE;
|
return EXIT_UNAUTHORIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if --synchronize or --monitor not passed in, exit & display help
|
// if --synchronize or --monitor not passed in, exit & display help
|
||||||
|
|
Loading…
Reference in a new issue