Skip to content

Commit 5e4bff6

Browse files
committed
fix: systemd NAMESPACE crash - move sandbox dir to /opt/pennyclaw/sandbox
Root cause: PrivateTmp=true creates a private /tmp namespace, but ReadWritePaths referenced /tmp/pennyclaw-sandbox which doesn't exist inside that namespace. systemd fails at NAMESPACE step before the process even starts (status=226/NAMESPACE). Fix: Move sandbox working directory from /tmp/pennyclaw-sandbox to /opt/pennyclaw/sandbox, which is already under the ReadWritePaths prefix. This keeps PrivateTmp=true security hardening intact.
1 parent 748eaaf commit 5e4bff6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/deploy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ if [ ! -f config.json ]; then
600600
},
601601
"channels": { "web": { "enabled": true } },
602602
"memory": { "db_path": "data/pennyclaw.db", "max_history": 50, "persist_sessions": true },
603-
"sandbox": { "enabled": true, "work_dir": "/tmp/pennyclaw-sandbox", "max_timeout": 30, "max_memory": 128 },
603+
"sandbox": { "enabled": true, "work_dir": "/opt/pennyclaw/sandbox", "max_timeout": 30, "max_memory": 128 },
604604
"system_prompt": "You are PennyClaw, a helpful personal AI assistant."
605605
}
606606
CONFIG
@@ -636,7 +636,7 @@ CPUQuota=80%
636636
NoNewPrivileges=true
637637
ProtectSystem=strict
638638
ProtectHome=true
639-
ReadWritePaths=/opt/pennyclaw/data /tmp/pennyclaw-sandbox
639+
ReadWritePaths=/opt/pennyclaw/data /opt/pennyclaw/sandbox
640640
PrivateTmp=true
641641
642642
# Environment
@@ -648,8 +648,8 @@ SERVICE
648648
649649
# Create pennyclaw user
650650
useradd -r -s /bin/false pennyclaw 2>/dev/null || true
651-
mkdir -p /tmp/pennyclaw-sandbox
652-
chown -R pennyclaw:pennyclaw /opt/pennyclaw /tmp/pennyclaw-sandbox 2>/dev/null || true
651+
mkdir -p /opt/pennyclaw/sandbox
652+
chown -R pennyclaw:pennyclaw /opt/pennyclaw 2>/dev/null || true
653653
654654
# Enable and start
655655
systemctl daemon-reload

0 commit comments

Comments
 (0)