redis-server service:cannot open PID file var/ru

I am new to Ubuntu server. I have installed redis on Ubuntu 18.04 server, then I run this command if re`enter dis is active

sudo systemctl status redis

then it says:

redis-server service:cannot open PID file var/ru sysytemd[1]:started Advanced key value line 1-15

Now my console is not taking any normal command, it just says log file:...

https://i.stack.imgur.com/zPlkD.png


Your system has configured systemctl to send output through the less pager. You can just press q to exit and return to your terminal session.

You can prevent this behavior by using the --no-pager command line option, or permanently by setting the SYSTEMD_PAGER environment variable to the empty string. For example, you might place this in your .bashrc file:

export SYSTEMD_PAGER=''

You are not having a problem with redis and can ignore the message about a missing PID file.


In ubuntu 20.04 the /etc/redis/redis.conf file find

pidfile /var/run/redis_6379.pid

and change to

pidfile /run/redis/redis-server.pid

the systemctl on ubuntu 20.04 checks for "/run/redis/redis-server.pid" file and cant find it. As a result the systemctl restarts services