Okay I figured out what is causing this behavior. If I log in directly as root either through ssh or locally, I am able to run the db command , but not if I log in as my user then su to root. But I can run it after I su to root by running it from its path /sbin/e-smith/db I guess it was just a combination of /sbin/e-smith/ not being in my path after I su to root, and the whereis command not searching that directory by default.