ollie: remove daemon subcommands, centralize service file management
olliesrv no longer has start/fgstart/stop/status subcommands — it runs in the foreground and relies on the supervisor (systemd, openrc, or xdg-autostart) for lifecycle management. This simplifies the binary and makes the single-process model explicit. Changes: - All docs: olliesrv start → olliesrv - justfile: add install-services target, used by all install recipes; installs systemd user unit, openrc init script, xdg autostart entry; remove inline autostart installs from individual targets - systemd unit: ExecStart drops "start" subcommand - openrc init script: deleted (was for daemonized start; now managed via install-services) - xdg-autostart: new desktop entry (moved from 9p/ submodule), Exec=olliesrv (no longer shells out to start + remount) - contrib/ollie-remount: add debug echo for namespace/socket - 9p submodule: remove daemon subcommands from Go code; delete old desktop file - el submodule: update README for foreground-only olliesrv
This commit is contained in:
parent
90b9990ae4
commit
fd27166c12
2
9p
2
9p
|
|
@ -1 +1 @@
|
|||
Subproject commit af7363cb1dd2d4e5c37ac03296079eb9f0a01451
|
||||
Subproject commit cbd249e5f9eaed03b2b16aa193990d8356280f85
|
||||
|
|
@ -246,8 +246,8 @@ The 9P server embeds the core library directly — no display server, no desktop
|
|||
The embedded D-Bus adapter is automatically disabled when using `-tcp` (remote listen mode). You can also disable it explicitly with `-nodbus`:
|
||||
|
||||
```sh
|
||||
olliesrv start -tcp :5640 # TCP listener, no D-Bus (implied)
|
||||
olliesrv start -nodbus # Unix socket only, no D-Bus
|
||||
olliesrv -tcp :5640 # TCP listener, no D-Bus (implied)
|
||||
olliesrv -nodbus # Unix socket only, no D-Bus
|
||||
```
|
||||
|
||||
### Shell composability
|
||||
|
|
|
|||
|
|
@ -8,5 +8,8 @@ OLLIE="${OLLIE:-$HOME/mnt/ollie}"
|
|||
NAMESPACE="${NAMESPACE:-/tmp/ns.$(id -un).$(echo "${DISPLAY:-:0}" | tr / _)}"
|
||||
SOCK="$NAMESPACE/ollie"
|
||||
|
||||
echo $NAMESPACE
|
||||
echo $SOCK
|
||||
|
||||
sudo umount -f "$OLLIE" 2>/dev/null || true
|
||||
9pfuse "$SOCK" "$OLLIE"
|
||||
|
|
|
|||
16
doc/USAGE.md
16
doc/USAGE.md
|
|
@ -5,16 +5,14 @@
|
|||
### Start and stop
|
||||
|
||||
```sh
|
||||
olliesrv start # start in background (daemonizes)
|
||||
olliesrv fgstart # start in foreground
|
||||
olliesrv stop # stop the daemon
|
||||
olliesrv status # check if running
|
||||
olliesrv # start the server (foreground)
|
||||
# Stop by sending SIGTERM or via the supervisor (e.g. rc-service ollie stop)
|
||||
```
|
||||
|
||||
By default the server mounts at `$HOME/mnt/ollie`. Override with `-mount`:
|
||||
|
||||
```sh
|
||||
olliesrv start -mount /tmp/ollie
|
||||
olliesrv -mount /tmp/ollie
|
||||
```
|
||||
|
||||
### TCP listener
|
||||
|
|
@ -22,7 +20,7 @@ olliesrv start -mount /tmp/ollie
|
|||
To also accept connections over TCP (e.g. for remote access):
|
||||
|
||||
```sh
|
||||
olliesrv start -tcp :9564
|
||||
olliesrv -tcp :9564
|
||||
```
|
||||
|
||||
### Debug logging
|
||||
|
|
@ -30,7 +28,7 @@ olliesrv start -tcp :9564
|
|||
Log level is controlled by `OLLIE_LOG` (default: `warn`). Set to `debug` for verbose output:
|
||||
|
||||
```sh
|
||||
OLLIE_LOG=debug olliesrv fgstart
|
||||
OLLIE_LOG=debug olliesrv
|
||||
```
|
||||
|
||||
Valid levels: `debug`, `info`, `warn`, `error`. Per-subsystem overrides follow the pattern
|
||||
|
|
@ -542,8 +540,8 @@ ollie-httpgw -net tcp -addr host:9564 # connect to remote olliesrv over TCP
|
|||
| `-addr` | `` | 9P server address; required when `-net` is set |
|
||||
|
||||
The gateway must be able to reach `olliesrv`. For a local server started with
|
||||
`olliesrv start`, the defaults work as-is. For a remote server started with
|
||||
`olliesrv start -tcp :9564`, use `-net tcp -addr remotehost:9564`.
|
||||
`olliesrv`, the defaults work as-is. For a remote server started with
|
||||
`olliesrv -tcp :9564`, use `-net tcp -addr remotehost:9564`.
|
||||
|
||||
### HTTP → 9P mapping
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ An AI agent exposed as a filesystem. Mount it, then use shell tools.
|
|||
## Quick start
|
||||
|
||||
```sh
|
||||
olliesrv start # start the 9P server
|
||||
olliesrv # start the 9P server
|
||||
echo "cwd=$PWD" > ~/mnt/ollie/s/new # create a session
|
||||
ls ~/mnt/ollie/s/ # find the session ID
|
||||
echo "hello" > ~/mnt/ollie/s/<id>/prompt # send a prompt
|
||||
|
|
|
|||
2
el
2
el
|
|
@ -1 +1 @@
|
|||
Subproject commit 895da7cb778c0bf141b4ae4580f5de6a676350c8
|
||||
Subproject commit 4f7a22c29a0911fac80ede52be67f5980c9be87b
|
||||
32
justfile
32
justfile
|
|
@ -82,29 +82,25 @@ kde-kf5:
|
|||
|
||||
# === Install targets ===
|
||||
|
||||
install-9p: test install-data install-scripts install-contrib install-kde install-el
|
||||
install-9p: test install-data install-scripts install-contrib install-kde install-el install-services
|
||||
install -m644 prompts/SYSTEM_PROMPT.md {{cfg}}/prompts/SYSTEM_PROMPT.md
|
||||
install -m644 prompts/session-9p.md {{cfg}}/prompts/session.md
|
||||
mkdir -p ~/.config/autostart
|
||||
install -m644 9p/org.ollie.olliesrv.desktop ~/.config/autostart/
|
||||
@echo === Install complete \(9P\) ===
|
||||
@echo 'Restart Plasma to pick up KDE plugins.'
|
||||
|
||||
install-dbus: test install-data install-scripts install-contrib install-dbus-bin install-kde
|
||||
install-dbus: test install-data install-scripts install-contrib install-dbus-bin install-kde install-services
|
||||
install -m644 prompts/SYSTEM_PROMPT.md {{cfg}}/prompts/SYSTEM_PROMPT.md
|
||||
install -m644 prompts/session-dbus.md {{cfg}}/prompts/session.md
|
||||
@echo === Install complete \(D-Bus\) ===
|
||||
@echo 'Restart Plasma to pick up KDE plugins.'
|
||||
|
||||
install-ninep-kf5: test install-data install-scripts install-contrib install-kde-kf5 install-el
|
||||
install-ninep-kf5: test install-data install-scripts install-contrib install-kde-kf5 install-el install-services
|
||||
install -m644 prompts/SYSTEM_PROMPT.md {{cfg}}/prompts/SYSTEM_PROMPT.md
|
||||
install -m644 prompts/session-9p.md {{cfg}}/prompts/session.md
|
||||
mkdir -p ~/.config/autostart
|
||||
install -m644 9p/org.ollie.olliesrv.desktop ~/.config/autostart/
|
||||
@echo === Install complete \(9P + KF5\) ===
|
||||
@echo 'Restart Plasma to pick up KDE plugins.'
|
||||
|
||||
install-dbus-kf5: test install-data install-scripts install-contrib install-dbus-bin install-kde-kf5
|
||||
install-dbus-kf5: test install-data install-scripts install-contrib install-dbus-bin install-kde-kf5 install-services
|
||||
install -m644 prompts/SYSTEM_PROMPT.md {{cfg}}/prompts/SYSTEM_PROMPT.md
|
||||
install -m644 prompts/session-dbus.md {{cfg}}/prompts/session.md
|
||||
@echo === Install complete \(D-Bus + KF5\) ===
|
||||
|
|
@ -284,6 +280,18 @@ install-scripts:
|
|||
install -m755 scripts/x/prime {{cfg}}/scripts/x/prime
|
||||
install -m755 scripts/x/freeloader {{cfg}}/scripts/x/freeloader
|
||||
|
||||
install-services:
|
||||
@echo === Installing service files ===
|
||||
# systemd (user)
|
||||
mkdir -p ~/.config/systemd/user
|
||||
install -m644 services/systemd/ollie.service ~/.config/systemd/user/
|
||||
# openrc (user)
|
||||
mkdir -p ~/.config/rc/init.d
|
||||
install -m755 services/openrc/ollie.initd ~/.config/rc/init.d/ollie
|
||||
# xdg autostart (fallback when no supervisor)
|
||||
mkdir -p ~/.config/autostart
|
||||
install -m644 services/xdg-autostart/org.ollie.olliesrv.desktop ~/.config/autostart/
|
||||
|
||||
install-contrib:
|
||||
@echo === Installing contrib scripts ===
|
||||
mkdir -p {{bin}}
|
||||
|
|
@ -299,11 +307,14 @@ uninstall:
|
|||
rm -f {{bin}}/Ollie {{bin}}/Kmpl {{bin}}/Oi {{bin}}/Theo
|
||||
rm -f {{bin}}/ollie-remount {{bin}}/ollie-watchdog
|
||||
rm -rf {{cfg}}
|
||||
rm -f ~/.config/autostart/org.ollie.olliesrv.desktop
|
||||
# D-Bus daemon
|
||||
pkill -u "$(id -u)" -x ollied 2>/dev/null; true
|
||||
rm -f ~/.local/bin/ollied
|
||||
rm -f ~/.config/autostart/org.ollie.SessionManager.desktop
|
||||
# Service files
|
||||
rm -f ~/.config/systemd/user/ollie.service
|
||||
rm -f ~/.config/rc/init.d/ollie
|
||||
rm -f ~/.config/autostart/org.ollie.olliesrv.desktop
|
||||
# KDE
|
||||
rm -f ~/.local/bin/ollie-tray ~/.local/bin/ollie-gui
|
||||
rm -f ~/.local/bin/ollie-ask ~/.local/bin/ollie-session-here
|
||||
|
|
@ -328,6 +339,9 @@ uninstall-ninep-kf5:
|
|||
rm -f {{bin}}/Ollie {{bin}}/Kmpl {{bin}}/Oi {{bin}}/Theo
|
||||
rm -f {{bin}}/ollie-remount {{bin}}/ollie-watchdog
|
||||
rm -rf {{cfg}}
|
||||
# Service files
|
||||
rm -f ~/.config/systemd/user/ollie.service
|
||||
rm -f ~/.config/rc/init.d/ollie
|
||||
rm -f ~/.config/autostart/org.ollie.olliesrv.desktop
|
||||
# KDE (KF5)
|
||||
rm -f ~/.local/bin/ollie-tray ~/.local/bin/ollie-gui
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
description="Ollie server daemon (olliesrv)"
|
||||
|
||||
supervisor=supervise-daemon
|
||||
|
||||
command="${HOME}/bin/olliesrv"
|
||||
command_args="start"
|
||||
|
||||
output_log="${XDG_RUNTIME_DIR}/ollie/olliesrv.log"
|
||||
error_log="${XDG_RUNTIME_DIR}/ollie/olliesrv.log"
|
||||
|
||||
respawn_delay=3
|
||||
respawn_max=10
|
||||
respawn_period=60
|
||||
|
||||
depend() {
|
||||
need dbus
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -o $USER -d "${XDG_RUNTIME_DIR}/ollie"
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ Requires=dbus.service
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/bin/olliesrv start
|
||||
ExecStart=%h/bin/olliesrv
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Environment=XDG_RUNTIME_DIR=/run/user/%U
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Ollie Server
|
||||
GenericName=AI Agent 9P Server
|
||||
Comment=9P server for Ollie AI agent sessions (includes embedded D-Bus adapter)
|
||||
Exec=olliesrv
|
||||
Icon=ollie
|
||||
Terminal=false
|
||||
Categories=Utility;
|
||||
X-DBUS-StartupType=unique
|
||||
X-DBUS-ServiceName=org.ollie.SessionManager
|
||||
Loading…
Reference in New Issue