-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcom.systemmonitor.client.plist
More file actions
123 lines (104 loc) · 3.74 KB
/
Copy pathcom.systemmonitor.client.plist
File metadata and controls
123 lines (104 loc) · 3.74 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
System Monitor Client - macOS launchd service file
Requirements: 6.1 - Deploy client as macOS launchd service
Installation Instructions:
1. Build the project: npm run build
2. Create config.json with your configuration
3. Update the paths in this file (WorkingDirectory, ProgramArguments)
4. Copy this file to LaunchAgents or LaunchDaemons:
For current user (recommended for testing):
cp com.systemmonitor.client.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.systemmonitor.client.plist
For system-wide (requires sudo):
sudo cp com.systemmonitor.client.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/com.systemmonitor.client.plist
Service Management Commands:
Load: launchctl load ~/Library/LaunchAgents/com.systemmonitor.client.plist
Unload: launchctl unload ~/Library/LaunchAgents/com.systemmonitor.client.plist
Start: launchctl start com.systemmonitor.client
Stop: launchctl stop com.systemmonitor.client
Status: launchctl list | grep systemmonitor
Logs: tail -f /tmp/system-monitor-client.log
-->
<plist version="1.0">
<dict>
<!-- Service label (unique identifier) -->
<key>Label</key>
<string>com.systemmonitor.client</string>
<!-- Program to run -->
<key>ProgramArguments</key>
<array>
<!-- UPDATE THIS PATH to your Node.js installation -->
<string>/usr/local/bin/node</string>
<!-- UPDATE THIS PATH to your installation directory -->
<string>/opt/system-monitor-client/dist/index.js</string>
</array>
<!-- Working directory - UPDATE THIS PATH -->
<key>WorkingDirectory</key>
<string>/opt/system-monitor-client</string>
<!-- Run at load (start automatically) -->
<key>RunAtLoad</key>
<true/>
<!-- Keep the service alive (restart if it crashes) -->
<key>KeepAlive</key>
<dict>
<!-- Restart if the process crashes -->
<key>SuccessfulExit</key>
<false/>
<!-- Don't restart if it exits cleanly -->
<key>Crashed</key>
<true/>
</dict>
<!-- Restart throttle interval (seconds) -->
<key>ThrottleInterval</key>
<integer>10</integer>
<!-- Environment variables -->
<key>EnvironmentVariables</key>
<dict>
<key>NODE_ENV</key>
<string>production</string>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<!-- Standard output log file -->
<key>StandardOutPath</key>
<string>/tmp/system-monitor-client.log</string>
<!-- Standard error log file -->
<key>StandardErrorPath</key>
<string>/tmp/system-monitor-client.error.log</string>
<!-- Process type (Adaptive is recommended for long-running services) -->
<key>ProcessType</key>
<string>Adaptive</string>
<!-- Nice value (process priority, -20 to 20, lower = higher priority) -->
<key>Nice</key>
<integer>0</integer>
<!-- Soft resource limits (optional) -->
<key>SoftResourceLimits</key>
<dict>
<!-- Maximum number of open files -->
<key>NumberOfFiles</key>
<integer>1024</integer>
</dict>
<!-- Hard resource limits (optional) -->
<key>HardResourceLimits</key>
<dict>
<!-- Maximum number of open files -->
<key>NumberOfFiles</key>
<integer>2048</integer>
</dict>
<!-- User to run as (optional, for system-wide daemons) -->
<!-- Uncomment if installing to /Library/LaunchDaemons -->
<!--
<key>UserName</key>
<string>_systemmonitor</string>
<key>GroupName</key>
<string>_systemmonitor</string>
-->
<!-- Session type (optional) -->
<!-- Use "Aqua" for user agents, "Background" for daemons -->
<key>SessionCreate</key>
<false/>
</dict>
</plist>