Skip to content
2 changes: 1 addition & 1 deletion src/agents/prompts/templates/partials/environment.eta
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- `redis-cli KEYS "*"` - List all keys (use sparingly)
- `redis-cli FLUSHALL` - Clear all data (use with caution)
- `redis-cli INFO` - Get server statistics
- **Start**: `su redis -c 'redis-server /etc/redis/redis.conf --daemonize yes'`
- **Start**: `su -s /bin/sh redis -c 'redis-server /etc/redis/redis.conf --daemonize yes'`
- **Stop**: `redis-cli SHUTDOWN`
- **Monitor**: `redis-cli MONITOR` - Watch all commands in real-time
- **Data persistence**: AOF enabled (data survives restarts)
Expand Down
4 changes: 2 additions & 2 deletions src/agents/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ export async function startRedis(): Promise<void> {

try {
// Start Redis in background using redis-server
// We use su to run as redis user, and redirect stderr to capture startup errors
// We use su -s /bin/sh to run as redis user (redis user has /usr/sbin/nologin shell by default)
const startResult = await execCommand(
'su',
['redis', '-c', `redis-server ${REDIS_CONF} --daemonize yes 2>&1`],
['-s', '/bin/sh', 'redis', '-c', `redis-server ${REDIS_CONF} --daemonize yes 2>&1`],
'/',
);
logger.debug('redis-server start output', {
Expand Down