File size: 1,852 Bytes
383cb38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

name: atom-stop
description: Stop Atom OS background daemon gracefully
version: 1.0.0
author: Atom Team
tags: [atom, cli, stop, shutdown]
maturity_level: AUTONOMOUS
governance:
  maturity_requirement: AUTONOMOUS
  reason: "Stopping daemon terminates service, requires full autonomy"
---


# Atom Daemon Stopper

Stop Atom OS background daemon gracefully with cleanup.

## Usage

Execute this skill to stop the daemon:
```

atom-os stop

```

## Behavior

1. **Graceful Shutdown:** Sends SIGTERM signal to daemon process
2. **Timeout Waits:** Waits up to 10 seconds for graceful shutdown
3. **Force Kill:** If still running after timeout, sends SIGKILL
4. **Cleanup:** Removes PID file automatically

## Examples

Stop running daemon:
```

atom-os stop

```

Expected output (success):
```

✓ Atom OS stopped (PID: 12345)

```

Expected output (not running):
```

ℹ Atom OS was not running

```

## Output

- Success message with PID (if daemon was running)
- Info message (if daemon was not running)

## Shutdown Process

1. Read PID from ~/.atom/pids/atom-os.pid
2. Send SIGTERM to process
3. Wait up to 10 seconds for process to exit
4. If still alive, send SIGKILL
5. Remove PID file

## Error Handling

- **Stale PID file:** If process died unexpectedly, cleanup happens automatically
- **Permission denied:** Requires same user permissions as daemon startup
- **PID file missing:** Treated as "not running"

## Notes

⚠️ **AUTONOMOUS maturity required** - This command terminates the background service.

**Graceful vs. Force Kill:**
- SIGTERM (graceful): Allows Atom to save state, close connections
- SIGKILL (force): Immediate termination if graceful shutdown fails

## Related Commands

- `atom-os daemon` - Start daemon
- `atom-os status` - Check daemon status