SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/run is owned by root, so only root can remove /run/ntpd.pid. In Linux you must have write permissions on the directory in order to have the permission to remove a file from it, the permissions or the ownership of the file is immaterial.
But there are more fundamental issues here.
ntp uses port 123. For all practical matters: Linux allows only root-owned processes to bind to ports below 1024 (the actual permissions are based on Linux-specific "capabilities", but this gets too deep in the weeds here).
TLDR: you need to be root in order to start or stop ntpd. Non-root permissions won't be enough.
Add your user to the sudoers file, allow it to use ntpdate, and then use "sudo ntpdate -u time.nist.gov" instead.
Something like this should work (and not even ask for your inukaze account password):
# more /etc/sudoers.d/ntpdate
inukaze your-hostname-here = NOPASSWD: /usr/bin/ntpdate
For more information,
man sudo
man sudoers
Also, ntpd is a service you start once and let it do its thing; no need to keep restarting it.
Add your user to the sudoers file, allow it to use ntpdate, and then use "sudo ntpdate -u time.nist.gov" instead.
Something like this should work (and not even ask for your inukaze account password):
# more /etc/sudoers.d/ntpdate
inukaze your-hostname-here = NOPASSWD: /usr/bin/ntpdate
For more information,
man sudo
man sudoers
Also, ntpd is a service you start once and let it do its thing; no need to keep restarting it.
Yesterday i had do that, but my on my sudoers file, becuase when i make a custom file inside /etc/sudoers.d/ntp , the thing does not work i hope, but after i move the line to sudoers and using the command
Code:
visudo -c
to check the syntax i and notice i wrote bad in multiples times, things like the commands not should be write like "/sbin/hwclock", because does not work.
well the thing is when i try to run the command like my user :
Code:
ntpdate -u time.nist.gov
Quote:
29 Apr 16:13:04 ntpdate[3331]: Can't adjust the time of day: Operation not permitted
Why the error msg change ? , some hours ago was "step-systime : Operation not permitted"
Quote:
29 Apr 15:21:27 ntpdate[2665]: step-systime: Operation not permitted
after i do
Code:
su -c "ln -sf /sbin/hwclock /usr/bin/hwclock" root
after i edit my /etc/rc.d/rc.local and add the follow lines between the first lines :
Code:
# Sincronizar Hora durante el arranque :
if [ -x /etc/rc.d/rc.ntpd ]; then
/etc/rc.d/rc.ntpd stop
/usr/sbin/ntpd/ntpd -gq > /dev/null 2>&1
hwclock -w
/etc/rc.d/rc.ntpd start
fi
> well the thing is when i try to run the command like my user :
>
> ntpdate -u time.nist.gov
Did you try `sudo ntpdate -u time.nist.gov`? Adding the custom sudoers file is the first part of the puzzle, but you still need to use `sudo` when running the command
> well the thing is when i try to run the command like my user :
>
> ntpdate -u time.nist.gov
Did you try `sudo ntpdate -u time.nist.gov`? Adding the custom sudoers file is the first part of the puzzle, but you still need to use `sudo` when running the command
Code:
sudo ntpdate -u time.nist.gov ; sudo hwclock -w
Quote:
30 Apr 17:04:39 ntpdate[22694]: adjust time server 132.163.97.3 offset -0.001452 sec
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.