gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] gpsd always starting in foregound


From: Jobs, Steve
Subject: [gpsd-users] gpsd always starting in foregound
Date: Fri, 16 May 2014 21:22:12 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Hello gpsd-users and thank you for your patience with my first post/question.

Problem:
gpsd is always staring in the foreground (-N) with no additional arguments.

Hardware:
beaglebone black

OS:
Debain wheezy image from beaglebone site with jessie sources. Full upgrade/dist-update, and heavy package cleanout.

version:
3.10+dev1~a33bfd44-2

Repeatability:
always (6 different re-imagings of the bone and countless uninstalls and reinstalls of gpsd)

Other cases:
Even with the stock Debain wheezy image, the installation of gpsd (v3.6-4) acts the same.

More information:
Using the angstrom image that comes with the beaglebone black I was able to successfully install and use gpsd. I could also use cgps do see the data.

For both debian versions I have correctly set the config setting, using db-reconfigure with wheezy and directly modifying /etc/default/gpsd in jessie.

<code>
address@hidden:/var/log# cat /etc/default/gpsd
# Default settings for gpsd.

# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="true"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyO4"

# gpsd control socket location.
GPSD_SOCKET="/run/gpsd/gpsd.sock"

# Other options you want to pass to gpsd
GPSD_OPTIONS=""
</code>

The gps module (ls20031) is connected to UART4 on the bone. The tty is setup correctly and I am always able to cat out the device and see the NMEA messages.

If I actaully attempt to run gpsd in the foreground, such as gpsd -D8 -N /dev/ttyO4 I get:
<code>
address@hidden:/var/log# gpsd -F /var/run/gpsd.sock -D8 -N /dev/ttyO4
gpsd:SPIN: control socket /var/run/gpsd.sock is fd 3
gpsd:PROG: control socket opened at /var/run/gpsd.sock
gpsd:INFO: launching (Version 3.11~dev)
gpsd:IO: opening IPv4 socket
gpsd:ERROR: can't bind to IPv4 port gpsd, Address already in use
gpsd:ERROR: maybe gpsd is already running!
gpsd:IO: opening IPv6 socket
gpsd:SPIN: passivesock_af() -> 4
gpsd:INFO: listening on port gpsd
gpsd:PROG: NTPD shmat(0,0,0) succeeded, segment 0
gpsd:PROG: NTPD shmat(32769,0,0) succeeded, segment 1
gpsd:PROG: NTPD shmat(65538,0,0) succeeded, segment 2
gpsd:PROG: NTPD shmat(98307,0,0) succeeded, segment 3
gpsd:PROG: successfully connected to the DBUS system bus
gpsd:PROG: shmat() succeeded, segment 131076
gpsd:PROG: shared-segment creation succeeded,
gpsd:INFO: stashing device /dev/ttyO4 at slot 0
gpsd:INFO: running with effective group ID 20
gpsd:INFO: running with effective user ID 105
gpsd:INFO: startup at 2014-05-17T01:03:46.000Z (1400288626)
</code>
with no further output.

I can see that even when gpsd is stopped there is something holding onto the 2947 port:
<code>
address@hidden:/var/log# ps -ef | grep gpsd
root      1486  1090  0 21:05 pts/0    00:00:00 grep gpsd
address@hidden:/var/log# netstat -an | grep 2947
tcp        0      0 127.0.0.1:2947          0.0.0.0:*               LISTEN
address@hidden:/var/log# lsof | grep gpsd
systemd 1 root 33u unix 0xde481a00 0t0 6652 /var/run/gpsd.sock systemd 1 root 34u IPv4 6654 0t0 TCP localhost:gpsd (LISTEN)
</code>

This is what ps shows me every time I try to start gpsd:
<code>
address@hidden:/var/log# /etc/init.d/gpsd start
[ ok ] Starting gpsd (via systemctl): gpsd.service.
address@hidden:/var/log# ps -ef | grep gpsd
gpsd      1598     1  1 21:09 ?        00:00:00 /usr/sbin/gpsd -N
root      1618  1090  0 21:09 pts/0    00:00:00 grep gpsd
</code>

Here is the strace output:
<code>
execve("./gpsd", ["./gpsd", "start"], [/* 18 vars */]) = 0
brk(0)                                  = 0xb6f62000
uname({sys="Linux", node="beaglebone", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f41000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=35175, ...}) = 0
mmap2(NULL, 35175, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f1b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0Mw\1\0004\0\0\0"..., 512) = 512
lseek(3, 912284, SEEK_SET)              = 912284
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
lseek(3, 908836, SEEK_SET)              = 908836
read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 53
fstat64(3, {st_mode=S_IFREG|0755, st_size=915164, ...}) = 0
mmap2(NULL, 951728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6e32000
mprotect(0xb6f0d000, 32768, PROT_NONE)  = 0
mmap2(0xb6f15000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xdb) = 0xb6f15000 mmap2(0xb6f18000, 9648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f18000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f40000
set_tls(0xb6f40850, 0xb6f44050, 0xb6f40f38, 0xb6f40850, 0xb6f44050) = 0
mprotect(0xb6f15000, 8192, PROT_READ)   = 0
mprotect(0xb6f5e000, 4096, PROT_READ)   = 0
mprotect(0xb6f43000, 4096, PROT_READ)   = 0
munmap(0xb6f1b000, 35175)               = 0
getpid()                                = 3757
rt_sigaction(SIGCHLD, {0xb6f51bfd, ~[RTMIN RT_1], 0x4000000 /* SA_??? */}, NULL, 8) = 0
geteuid32()                             = 0
brk(0)                                  = 0xb6f62000
brk(0xb6f83000)                         = 0xb6f83000
getppid()                               = 3756
stat64("/etc/init.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("./gpsd", O_RDONLY)                = 3
fcntl64(3, F_DUPFD, 10)                 = 10
close(3)                                = 0
fcntl64(10, F_SETFD, FD_CLOEXEC)        = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0xb6f51bfd, ~[RTMIN RT_1], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], 0x4000000 /* SA_??? */}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], 0x4000000 /* SA_??? */}, NULL, 8) = 0
read(10, "#!/bin/sh\n### BEGIN INIT INFO\n# "..., 8192) = 4052
geteuid32()                             = 0
stat64("/usr/sbin/gpsd", {st_mode=S_IFREG|0755, st_size=35568, ...}) = 0
faccessat(AT_FDCWD, "/usr/sbin/gpsd", X_OK) = 0
faccessat(AT_FDCWD, "/etc/default/gpsd", R_OK) = 0
open("/etc/default/gpsd", O_RDONLY)     = 3
fcntl64(3, F_DUPFD, 10)                 = 11
close(3)                                = 0
fcntl64(11, F_SETFD, FD_CLOEXEC)        = 0
read(11, "# Default settings for gpsd.\n\n# "..., 8192) = 460
read(11, "", 8192)                      = 0
close(11)                               = 0
open("/lib/init/vars.sh", O_RDONLY)     = 3
fcntl64(3, F_DUPFD, 10)                 = 11
close(3)                                = 0
fcntl64(11, F_SETFD, FD_CLOEXEC)        = 0
read(11, "#\n# Set rcS vars\n#\n\n# Because /e"..., 8192) = 1212
stat64("/etc/default/rcS", {st_mode=S_IFREG|0644, st_size=620, ...}) = 0
open("/etc/default/rcS", O_RDONLY)      = 3
fcntl64(3, F_DUPFD, 10)                 = 12
close(3)                                = 0
fcntl64(12, F_SETFD, FD_CLOEXEC)        = 0
read(12, "#\n# /etc/default/rcS\n#\n# Default"..., 8192) = 620
read(12, "", 8192)                      = 0
close(12)                               = 0
faccessat(AT_FDCWD, "/proc/cmdline", R_OK) = 0
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3758
close(4)                                = 0
read(3, "console=tty0 console=ttyO0,11520"..., 128) = 128
read(3, "LT-HDMI,BB-BONELT-HDMIN root=UUI"..., 128) = 128
read(3, "d/systemd\n", 128)             = 10
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3758
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
read(11, "", 8192)                      = 0
close(11)                               = 0
open("/lib/lsb/init-functions", O_RDONLY) = 3
fcntl64(3, F_DUPFD, 10)                 = 11
close(3)                                = 0
fcntl64(11, F_SETFD, FD_CLOEXEC)        = 0
read(11, "# /lib/lsb/init-functions for De"..., 8192) = 8192
read(11, " Debian, would output \"Starting "..., 8192) = 3314
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3759
close(4)                                = 0
read(3, "/lib/lsb/init-functions.d/20-lef"..., 128) = 83
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3759
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
faccessat(AT_FDCWD, "/lib/lsb/init-functions.d/20-left-info-blocks", R_OK) = 0
open("/lib/lsb/init-functions.d/20-left-info-blocks", O_RDONLY) = 3
fcntl64(3, F_DUPFD, 10)                 = 12
close(3)                                = 0
fcntl64(12, F_SETFD, FD_CLOEXEC)        = 0
read(12, "# Default info blocks put to the"..., 8192) = 1088
read(12, "", 8192)                      = 0
close(12)                               = 0
faccessat(AT_FDCWD, "/lib/lsb/init-functions.d/40-systemd", R_OK) = 0
open("/lib/lsb/init-functions.d/40-systemd", O_RDONLY) = 3
fcntl64(3, F_DUPFD, 10)                 = 12
close(3)                                = 0
fcntl64(12, F_SETFD, FD_CLOEXEC)        = 0
read(12, "# -*-Shell-script-*-\n# /lib/lsb/"..., 8192) = 2408
stat64("/run/systemd/system", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3760
close(4)                                = 0
read(3, "/etc/init.d/gpsd\n", 128)      = 17
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3760
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn() = ? (mask now [HUP INT ILL BUS KILL])
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3761
close(4)                                = 0
read(3, "CanReload=no\n", 128)          = 13
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3761
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3762
close(4)                                = 0
read(3, "LoadState=loaded\n", 128)      = 17
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3762
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [QUIT])
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbed73f24) = -1 ENOTTY (Inappropriate ioctl for device) write(1, "Starting gpsd (via systemctl): g"..., 43Starting gpsd (via systemctl): gpsd.service) = 43 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f403f8) = 3763
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 3763
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn() = ? (mask now [ILL TRAP KILL SEGV USR2 ALRM TERM STKFLT CHLD STOP TTIN TTOU URG XCPU VTALRM PROF IO PWR RTMIN]) ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbed73f54) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbed741cc) = -1 ENOTTY (Inappropriate ioctl for device)
write(1, ".\n", 2.
)                      = 2
close(12)                               = 0
close(11)                               = 0
exit_group(0)                           = ?
</code>

It looks like it is correctly reading in the config file and there are no errors, hence my confusion.

I didn't see any suggestions for particular log outputs so if anything else would be helpful please let me know.

Thanks,
Steve



reply via email to

[Prev in Thread] Current Thread [Next in Thread]