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.
I have been playing with gpsd and ntpd. I was trying to figure out if my usb gps device had a pulse per second output, it did not. I used ldattach 18 /dev/ttyACM0 (or a very similar device which was my usb gps) to create /dev/pps0. Now, despite the usb gps being unplugged and rebooting, /dev/pps0 remains. I have not got any rules for it in /ete/udev/rules.d etc nor anything in rc.local which creates it. I can't see how to get rid of it.
I want rid of it as it may be confusing things now I have a usb gps with working PPS that I want to connect.
Is ldattach launched automatically / running? Kill it.
Check if you have some pps* modules loading, unload them.
If still not able to get rid of it, check if/who's using it (process):
Code:
/usr/bin/fuser /dev/pps0
This will output a PID (or some). Look either with:
Is ldattach launched automatically / running? Kill it.
Check if you have some pps* modules loading, unload them.
If still not able to get rid of it, check if/who's using it (process):
Code:
/usr/bin/fuser /dev/pps0
This will output a PID (or some). Look either with:
root@phoenix:~# ls -al /dev/pps0
crw------- 1 root root 249, 0 Jun 1 00:03 /dev/pps0
That looks like normal character file, presumably created "mknod style" by ldattach and it should be removable.
The ldattach man states that it should get removed once the ldattach process ends. Don't know why it's still there:
Quote:
- snippet from man ldattach
In order to detach the line discipline, kill(1) the ldattach process.
That looks like normal character file, presumably created "mknod style" by ldattach and it should be removable.
The ldattach man states that it should get removed once the ldattach process ends. Don't know why it's still there:
Could you please provide the output of:
Code:
grep 249 /proc/devices
just to see which driver has the major 249.
OK
Code:
bash-4.3$ grep 249 /proc/devices
249 pps
I've plugged a gps device I am testing in, perhaps I should remove it? I did find a normal rm would delete /dev/pps0. However, it would reappear by magic on reboot even though I did not run ldattach. Further, if I delete /dev/pps0, as it is not being used, and then run ldattach having plugged in a suitable gps, I get /dev/pps1 not /dev/pps0.
Having deleted /dev/pps0 grepping /proc/devices has the same result.
The issue is that /dev/pps0 reappears on rebooting for no reason I can see, e.g. no GSP device plugged in, no gpsd, nothing in rc.local or modules inserted.
I thought it's a stale node, left over by an ungraceful exit of ldattach and that you cannot delete it - permission denied.
It turns out it is used by the pps driver and udev is creating it at startup, presumably because it loads the pps driver (can check it with "dmesg | grep pps") for the plugged gps device.
Yes, you should try removing the gps device, unload all pps drivers, delete the /dev/pps0 and check if/what udev stores in /etc/udev/hwdb.d and /etc/udev/devices
If you find there some related records, delete (backup them). Then, before restarting the system, flush the udev running database:
Code:
/sbin/udevadm info --cleanup-db
# and force it to refresh it
/sbin/udevadm control --reload-rules
/sbin/udevadm trigger
After these steps, check if you got the /dev/pps0 back and if negative, go for a restart - check again if it creates it at start-up.
I wanted to mention that /dev/pps0 exists on my 14.2 system and I've never hooked up a GPS or done any of the other things you've mentioned (however, it doesn't exist on my -current system that hasn't been upgraded for about a year). I suppose I did something over the course of the several years I've had the machine up and running to get it to populate, but if I did, it was unintentional.
If you're running 14.2, it's possible that /dev/pps0 being available is the default.
Just checked on the available systems:
- 2 Intel (x86) laptops running an up-to-date Slackware 14.2 - no /dev/pps*
- 1 Raspberry Pi Zero running an up-to-date Slackware ARM 14.2 - no /dev/pps*
- 1 Raspberry Pi 2B running an up-to-date Slackware ARM -current - no /dev/pps*
I didn't play with any modems/serial devices on these systems.
Interesting! I've never had a modem/serial devices hooked up to any of my computers (definitely never used ldattach or modprobed the pps module. I wonder what caused it to pop on mine... not enough to try and figure out how to get rid of it, but just curious.
I also have no experience (not that I remember) with ldattach and as mentioned in #7 I thought /dev/pps0 is a stale node entry (leftover). It should be udev remembering its state and re-creating it at boot / or when it loads the pps* modules. AFAIK, udev only stores persistent stuff in /etc/udev/hwdb.d and /etc/udev/devices, plus the user defined rules.
Had a look over the source code of ldattach (not that I'm a good C coder), learned that it only temporarily registers the line discipline, exactly how documented, meaning /dev/pps0 should be gone after ldattach exits. But then, I noticed some ioctl calls in the source code and I closed the tab immediately https://github.com/karelzak/util-lin...ils/ldattach.c
Mr. Karel Zak should know better how it works... https://github.com/karelzak/util-linux
I thought it's a stale node, left over by an ungraceful exit of ldattach and that you cannot delete it - permission denied.
It turns out it is used by the pps driver and udev is creating it at startup, presumably because it loads the pps driver (can check it with "dmesg | grep pps") for the plugged gps device.
Yes, you should try removing the gps device, unload all pps drivers, delete the /dev/pps0 and check if/what udev stores in /etc/udev/hwdb.d and /etc/udev/devices
If you find there some related records, delete (backup them). Then, before restarting the system, flush the udev running database:
Code:
/sbin/udevadm info --cleanup-db
# and force it to refresh it
/sbin/udevadm control --reload-rules
/sbin/udevadm trigger
After these steps, check if you got the /dev/pps0 back and if negative, go for a restart - check again if it creates it at start-up.
Thank you. I've avoided playing with udev unless essential. None of what you suggested fixed anything. However, this, and perhaps another message here got me to grep dmesg and I think ptp, precision time protocol, may be involved:
Code:
[ 0.416388] usbcore: registered new interface driver usbfs
[ 0.416533] usbcore: registered new interface driver hub
[ 0.416533] usbcore: registered new device driver usb
[ 0.416533] pps_core: LinuxPPS API ver. 1 registered
[ 0.416553] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.416780] PTP clock support registered
I note that the root file system mounted at 7.448 seconds. So the messaged before this cannot be influenced by and config or udev.
I suspect that when I built a recent kernel, checking for pps support I saw the option for ptp and though I might enable that. Usually enabling extra stuff does little harm. I believe my next step is to build a kernel without ptp to see if I loose the pps0 and see if it fixes the problems I have getting pps through to ntpd.
Well, I failed to realize that you're actually running a custom kernel and focused only on the stock Slackware kernel instead.
You mentioned in #3
Quote:
But this kernel was built with pps as modules:
and I thought you're referring to the stock kernel, didn't verify it
Your suspicion might be right, AFAIK only udev could keep some settings persistent through reboots and if that one is clean, then it's only the driver you enabled creating /dev/pps0 automatically. Your dmesg snippet also confirms that.
From this rather old doc: http://paul.chavent.free.fr/pps.html
- it looks like pps-ktimer is creating /dev/pps0
Had a look in the source of an actual kernel 4.x and found: /drivers/pps/clients/Kconfig
Quote:
config PPS_CLIENT_KTIMER
tristate "Kernel timer client (Testing client, use for debug)"
help
If you say yes here you get support for a PPS debugging client
which uses a kernel timer to generate the PPS signal.
This driver can also be built as a module. If so, the module
will be called pps-ktimer.
Looking back to your post #3, I believe you got this one compiled in-kernel instead of module and the kernel loads it automatically at boot, creating /dev/pps0. That's my theory
I will say that my 14.2 install is running a custom 5.4.30 kernel, but it is very close to Pat's 5.4.30 generic kernel config (took his config and set an AMD processor type and removed a few old things like pcmcia and parallel port support).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.