[clug-talk] Setting Time Programatically without being root
evan at totaltrucking.com
Tue Nov 30 16:05:40 PST 2004
Niels Voll wrote:
> that usually is not a very good idea - what's the underlying
> business/technical problem you're trying to solve? People might be
> able to suggest a better approach, if you are at liberty to divulge a
> bit more.
> Evan Brown wrote:
>> Is there a way to change the time on the system from a C program
>> without being logged in as root?
>> Evan Brown
Umm we have a device that's running linux from a flash drive, it
doesn't have a clock on the board so we need to have a way to update the
system time from our software. We get a time from GPS but we don't want
to rely on the GPS for the time since we may loose signal here and there
:). Anyway if our device is shut off we loose the system time, when it
restarts we want to be able to set the system time. We don't want to log
into linux as root, but we need to set the time. Whats the format to run
a command as root without having to su? We're not pumped at putting the
password for su in the program but if that's the case me may just do it.
More information about the clug-talk