Ubuntu: Launch eset libc library before samba daemon


Trying to configure "On-access scanner using preload LIBC library" in ESET File Security.

The manual states:

... to have the On-access scanner to monitor all file system access events immediately after starting the Samba server. Within the Samba daemon initialization script (/etc/init.d/smb), we would replace the statement

daemon /usr/sbin/smbd $SMBDOPTIONS   

with the following line:

LD_PRELOAD=@LIBDIR@/libesets_pac.so daemon /usr/sbin/smbd $SMBDOPTIONS   

But I do not have a file /etc/init.d/smb, but there is /etc/init.d/smbd.

Can anyone tell me where to inscribe this line that would LIBC library was launched before the start of samba?


So in the depths of /etc/init.d/smbd you'll find the following line which is what is actually launching smbd:

if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then  

The popular idea for passing through an environment variable is with env so you'd end up with:

if ! start-stop-daemon --start --quiet --oknodo --exec /usr/bin/env LD_PRELOAD=@LIBDIR@/libesets_pac.so /usr/sbin/smbd -- -D; then  

Note that I expect they want you to replace @LIBDIR@ with the correct path to libesets_pac.so.

An alternative is creating a new launcher for smbd as /usr/local/sbin/smbd:

#!/bin/sh    LD_PRELOAD=@LIBDIR@/libesets_pac.so /usr/sbin/smbd  

And then just alter /etc/init.d/smbd to call /usr/local/sbin/smbd.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »