Cleanup of redis databases/references after account removal.

iworx

Verified User
Joined
Nov 21, 2006
Messages
106
Location
Belgium
While updating Redis through a custom build, I noticed a few errors related to deleted accounts. These accounts had Redis enabled before they were terminated or deleted. It appears that DirectAdmin/Custombuild doesn’t clean up these references. Could you please advise me on where I can find these old or stale references?
 
Process: 2441234 ExecStart=/usr/local/bin/redis-server --include /usr/local/directadmin/data/users/${USER}/redis.conf --supervised systemd --dir ${HOME}/.redis/db/ --port 0 --unixsocket ${HOME}/.redis/redis.sock --unixsocketperm 770 (code=exited, status=217/USER)\
I found this one for that specific user but none of the paths resolve. Those user accounts are gone. It must be something just before this command.
 
If you found the correct service using above command on deleted user, then try "stop" and "disable".

the service safety to stop and disable because DA always start service per user-instance using "@user".
 
If you found the correct service using above command on deleted user, then try "stop" and "disable".

the service safety to stop and disable because DA always start service per user-instance using "@user".

I can confirm that it was already done on my end:

Bash:
[root@server ~]# systemctl disable [email protected] [email protected] [email protected]

even:

Bash:
[root@server ~]# cd /etc/systemd/system/multi-user.target.wants/
[root@server ~]# rm -fv [email protected] [email protected] [email protected]

so I have:

Bash:
[root@server ~]# ls -al /etc/systemd/system/multi-user.target.wants/redis@{bob,tom,john}.service
ls: cannot access '/etc/systemd/system/multi-user.target.wants/[email protected]': No such file or directory
ls: cannot access '/etc/systemd/system/multi-user.target.wants/[email protected]': No such file or directory
ls: cannot access '/etc/systemd/system/multi-user.target.wants/[email protected]': No such file or directory
[root@server ~]#

and still da build redis tries to restart mentioned instances:

Bash:
Hint: It's a good idea to run 'make test' ;)

    INSTALL redis-server
    INSTALL redis-benchmark
    INSTALL redis-cli
make[1]: Leaving directory '/usr/local/directadmin/custombuild/tmp/tmp.xNVIKLrl7O.redis-8.2.1.tar.gz/src'
Enabling redis in systemd...
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
Done redis.
[root@server ~]#

Thus it reports errors at the moment of "Enabling redis in systemd..."
 
I tried to create several times DA users with Redis enabled and then deleted them, but every time everything related to Redis is removed in the correct way (AlamaLinux 9.6 OS). If you use some specific OS or specific customization on DA server or you see any other pattern which can be the reason of this problem, please create ticket. Without such details and the way of reproducing the problem - it is difficult to say something useful.
 
@romans
Then... how to manual clean up the redis instance ?
When re-build the redis, it always trigger the restart instance on deleted user.
 
Back
Top