summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2009-12-23 01:14:11 +0000
committerGary E. Miller <gem@rellim.com>2009-12-23 01:14:11 +0000
commitb7164bb35fc60b255cd5c439dbcf5f44d665b90d (patch)
treec8da2c3b2f2dbe4eaf0bcd3f76c7adbb3171281d /ntpshm.c
parent00a660aa1127c19ce6365e42506ee9bc706a1c50 (diff)
downloadgpsd-b7164bb35fc60b255cd5c439dbcf5f44d665b90d.tar.gz
Add a good comment that gpsd CAN talk to ntpd as non-root.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 240b4815..ef540d9c 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -52,6 +52,20 @@ struct shmTime {
int pad[10];
};
+/* Note: you can start gpsd as non-root, and have it work with ntpd
+ * you MUST start gpsd before ntpd. Confirmed working in SVN 6900.
+ *
+ * to debug, try this:
+ * cat /proc/sysvipc/shm
+ *
+ * if you see the shared segments, and no gpsd or ntpd is running then
+ * try removeing them like this:
+ *
+ * ipcrm -M 0x4e545030
+ * ipcrm -M 0x4e545031
+ * ipcrm -M 0x4e545031
+ * ipcrm -M 0x4e545031
+ */
static /*@null@*/ struct shmTime *getShmTime(int unit)
{
int shmid;
@@ -68,8 +82,6 @@ static /*@null@*/ struct shmTime *getShmTime(int unit)
shmid=shmget ((key_t)(NTPD_BASE+unit),
sizeof (struct shmTime), IPC_CREAT|perms);
if (shmid == -1) {
- // to debug, try this:
- // cat /proc/sysvipc/shm
gpsd_report(LOG_ERROR, "NTPD shmget(%ld, %ld, %o) fail: %s\n",
(long int)(NTPD_BASE+unit),sizeof (struct shmTime), (int)0777, strerror(errno));
gpsd_report(LOG_ERROR,