Managing Redis service using Systemd

45 views
Skip to first unread message

nithin bharadwaj

unread,
Dec 20, 2021, 4:54:43 PM12/20/21
to Redis DB
Hi Team,

 We are using Redis 3.2 in  stand alone mode for Airflow.

 We used to start redis manually using nohup command and now we are trying to manage Redis service using Systemd.

  Following is the Service section of Redis service file.

 Type: notify
 WorkingDirectory: "..."
  ExecStart: /usr/bin/redis-server --supervised systemd
  Restart: on-failure
RestartSec: 30s
  
Everything is working fine but the dump.rdb is not created in the directory specified in the WorkingDirectory parameter of the Service file, when redis is started using systemd. Previously when redis is started manually using nohup ,dump.rdb file is created in the directory from which the redis server is started.

Is this the expected behaviour when redis is started using Systemd or am i missing any thing ?

Also tried modifying  the file as below

Type: simple
 WorkingDirectory: "..."
  ExecStart: /usr/bin/redis-server
  Restart: on-failure
RestartSec: 30s

in this case,  Redis server is started properly but  when i try to stop the service using systemctl , i get an error saying that "Error while saving DB Snapshot. Permission denied".When i start and stop  the service manually using the command specified in ExecStart parameter of the service file with the same user specified in the service file, i am not getting any error.Even tried changing the user and group to root in the service file, still i face the same error.

Any suggestions

Thanks,
Nithin Bharadwaj G
Reply all
Reply to author
Forward
0 new messages