How to Restart OpenSSL on Debian

debianopenssl

I have made some changes in openssl.cnf and wants to restart service. Normally I would just restart machine for changes to take effect but I don't want to restart machine. Tried sudo systemctl restart openssl but it didn't work as there is no such service.

How to I restart or reload openssl after making changes in configuration?

Best Answer

You can find all running processes that you might want to restart after an openssl change with:

ps -p $(grep -El 'libssl.so|libcrypto.so' /proc/*/maps|sed -r 's/\/proc\/([0-9]+)\/maps/\1/'|sort -nu)

The command search in the memory maps of each process and look for some of the openssl libs that are used by that command. Then it is displaying the process details for each match.

E.g. for systemd-journal process:

[root@laptop-rh ~]# grep -E 'libssl.so|libcrypto.so' /proc/938/maps
7f08dc800000-7f08dc8ad000 r--p 00000000 00:26 6540246                    /usr/lib64/libcrypto.so.3.0.9
7f08dc8ad000-7f08dcb11000 r-xp 000ad000 00:26 6540246                    /usr/lib64/libcrypto.so.3.0.9
7f08dcb11000-7f08dcbca000 r--p 00311000 00:26 6540246                    /usr/lib64/libcrypto.so.3.0.9
7f08dcbca000-7f08dcc21000 r--p 003ca000 00:26 6540246                    /usr/lib64/libcrypto.so.3.0.9
7f08dcc21000-7f08dcc24000 rw-p 00421000 00:26 6540246                    /usr/lib64/libcrypto.so.3.0.9
[root@laptop-rh ~]# ps -p 938
    PID TTY          TIME CMD
    938 ?        00:00:10 systemd-journal
[root@laptop-rh ~]# 

See also checkrestart.