Joined: 12 Sep 2008
|Posted: Wed 11 Mar 10:44:18 2009 Post subject: Running CDP applications as non-root user on Linux.
|Normally CDP applications must be run as root user on Linux due to a lot of priviliges it needs, such as setting Real-Time priorities etc. If you wish to run it as a user, for instance during development and debugging on a desktop computer, you have a few options:
=== SUDO ===
Grant your user sudo rights (in /etc/sudoers) and start CDP like this:
=== SUID ===
Make the binary owned by root and set it SUID and executable:
chown root CDP
chmod u+s CDP
chmod a+rx CDP
You can then run the CDP application as any user:
=== /etc/security/limits.conf ===
You can also escalate the priviliges of your user in general. Please see /etc/security/limits.conf where you'll want to allow real-time priorities and process priorities.
|username - rtprio 127
username - nice -20
You'll have to log out and log in again for these settings to take effect. See "ulimit -a" for current priviliges and "man limits.conf" for more details.
NOTE: Unlike the other options, this does not run CDP as root user "under the hood". Thus there might be other priviliges you need to grant or limitations to work around, such as the default WebServer port 80. (Anything below port 1024 requires root on Linux.)
Kent Dahl - Software Developer
Industrial Control Design AS - http://www.icd.no/