1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Registering the supervisor with whatever starts things on this machine.
//!
//! One job: make `ralon daemon` come back after a reboot without anybody typing
//! it. Each platform has a per-user mechanism for exactly this and each is used
//! as intended — a Task Scheduler logon task on Windows, a launchd LaunchAgent
//! on macOS. Both are per-user by construction, which is why none of this asks
//! for administrator or root. A tool that protects you from an agent should not
//! be the reason there is a privileged process on the machine for an agent to
//! talk to.
//!
//! Linux has the mechanism (a systemd user unit) and nothing for it to run: see
//! `unsupported.rs`.
use PathBuf;
use Result;
/// Whether a supervisor can be registered here at all.
pub const SUPPORTED: bool = SUPPORTED;
/// What happened, in terms a person can check by hand afterwards.
/// Registers the supervisor to start at logon, and starts it now.
///
/// `home` is passed through to the daemon rather than left to the environment.
/// A service inherits the environment of whatever started it — the launchd
/// bootstrap context, the Task Scheduler — not the shell that ran `ralon
/// install`, so a `RALON_HOME` that was set here would silently not apply there,
/// and the daemon would look after a different set of workspaces than the one
/// the developer just configured.
/// Removes the registration. `false` means there was none.
/// Whether the registration currently exists.
/// Why there is no supervisor here, for the platforms where there is not.