Sixthhokage2 / remuco

Automatically exported from code.google.com/p/remuco
1 stars 1 forks source link

Can't run remuco-mpd correctly at boot #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is your environment?
* OS: Archlinux
* Remuco version: 0.9.2
* Client device: Nokia 5500
* Player: mpd

I,m using Archlinux on my home music server without Xwindows (actually
without monitor at all)
Remuco works flawlessly, but I can't manage to start remuco-mpd at boot.
When I add "remuco-mpd &" to rc.local, remuco is present in process list,
but actually don't respond to client. But when I log in to console, and
manually start remuco-mpd, everything works.

How can I correctly start remuco at system boot?

Original issue reported on code.google.com by yaroslav.khomyak@gmail.com on 12 Nov 2009 at 9:17

GoogleCodeExporter commented 9 years ago
Ok, some questions:

- I guess in rc.local remuco-mpd gets started as root. Do you also use root when
  log in and then start remuco-mpd?
- What does the log say (~/.cache/remuco/mpd/log) when you start remuco-mpd in
  rc.local? Are there any warnings or errors?
- When you start remuco-mpd in rc.local and then log in and run `sdptool browse 
  local`, do you see the Remuco MPD service in the output (Service Name: MPD) ?

Original comment by obensonne@googlemail.com on 12 Nov 2009 at 7:41

GoogleCodeExporter commented 9 years ago
1. I tried both root and regular user

2 & 3. See log made exactly after boot:
remuco is running
log is empty (I've cleared file before reboot)
no BT service

[root@linuxhost mpd]# cd ~/.cache/remuco/mpd/
[root@linuxhost mpd]# ps -A | grep "remuco"
 1080 ?        00:00:02 remuco-mpd
[root@linuxhost mpd]# cat log
[root@linuxhost mpd]# sdptool browse > sdp
[root@linuxhost mpd]# cat sdp | grep "Service Name"
Service Name: AVRCP Target
Service Name: OBEX Object Push
Service Name: Imaging
Service Name: SyncMLClient
Service Name: OBEX File Transfer
Service Name: Nokia OBEX PC Suite Services
Service Name: Nokia SyncML Server
Service Name: Hands-Free Audio Gateway
Service Name: Headset Audio Gateway
Service Name: Dial-Up Networking
Service Name: COM7
Service Name: Audio Source
Service Name: Audio Sink
Service Name: Voice gateway
Service Name: Voice gateway
Service Name: File Transfer Service
Service Name: Object Push Service
Service Name: Imaging
[root@linuxhost mpd]#

Original comment by yaroslav.khomyak@gmail.com on 12 Nov 2009 at 8:26

GoogleCodeExporter commented 9 years ago
Empty log, that's strange (it's not empty if you run remuco-mpd as root when 
logged
in, right?). To work around this for now and to get some log output, please 
update
your rc.local to start remuco-mpd as follows:

remuco-mpd --remuco-log-stdout > /tmp/remuco.log 2>&1 &

Do you see some log output now (in /tmp/remuco.log) ?

Original comment by obensonne@googlemail.com on 12 Nov 2009 at 9:25

GoogleCodeExporter commented 9 years ago
Now it works! Bluetooth connected successfully!
What means "2>&1" in start command?

Log:

[root@linuxhost ~]# cat /tmp/remuco.log
2009-11-14 02:58:34,080 [   INFO] [  config.py  137] remuco version: 0.9.2
2009-11-14 02:58:34,087 [   INFO] [  config.py  576] system shutdown command (/.
config/remuco/shutdown-system) does not exist
2009-11-14 02:58:34,090 [WARNING] [   files.py  108] file system encoding is not
 UTF-8, this may cause problems with file browser features
2009-11-14 02:58:34,092 [   INFO] [   files.py  135] file browser root dirs: {''
: '/'}
2009-11-14 02:58:34,136 [   INFO] [ manager.py   56] start player adapter
2009-11-14 02:58:34,145 [   INFO] [     net.py  406] created bluetooth server
2009-11-14 02:58:34,151 [   INFO] [     net.py  406] created wifi server
2009-11-14 02:58:34,273 [   INFO] [ remuco-mpd  125] MPD version: 0.15.0
2009-11-14 02:58:34,275 [   INFO] [ manager.py   66] player adapter started
2009-11-14 02:58:34,277 [   INFO] [ manager.py  227] start main loop

Original comment by yaroslav.khomyak@gmail.com on 13 Nov 2009 at 11:14

GoogleCodeExporter commented 9 years ago
I think this should be added to MPD Wiki

Original comment by yaroslav.khomyak@gmail.com on 13 Nov 2009 at 11:15

GoogleCodeExporter commented 9 years ago
2>&1 redirects error out (2) to standard out (1), which is /tmp/remuco.log in 
this case.

Anyway, I'm surprised it works now. Actually I just recommended this start-up 
line to
be sure to get some log output.

When starting with "remuco-mpd &" in rc.local, I guess remuco-mpd hangs/blocks 
while
trying to write to the default log file (/root/.cache/remuco/mpd/log).

> I think this should be added to MPD Wiki

Just do it :)

But before declaring it as a "must do" you should ask other ArchLinux/MPD/Remuco
users there if they experienced the same issue. I think I'll add a note to the 
FAQ
section on the Remuco site.

Original comment by obensonne@googlemail.com on 13 Nov 2009 at 11:56

GoogleCodeExporter commented 9 years ago
I guess that remuco requires console to output. When started from rc.local, 
console
is not available, and it stucks.

Original comment by yaroslav.khomyak@gmail.com on 14 Nov 2009 at 12:48

GoogleCodeExporter commented 9 years ago
Hm, don't think so, but if you're right, remuco-mpd should also work in 
rc.local when
started it without the log option:

remuco-mpd > /tmp/remuco.log 2>&1 &

Now regular logging output goes into /root/.cache/remuco/mpd/log while the few 
lines
of standard out go into /tmp/remuco.log.

Original comment by obensonne@googlemail.com on 16 Nov 2009 at 9:16

GoogleCodeExporter commented 9 years ago
Hmm... now logs are not written, but remuco is available via bluetooth.
Seems that both of us are right :)))

Original comment by yaroslav.khomyak@gmail.com on 17 Nov 2009 at 7:55

GoogleCodeExporter commented 9 years ago
That's interesting.
Does it mean scripts started as services have no attached stdout? It kind of 
makes
sense if those processes are executed by /bin/init directly.

Original comment by igor.con...@gmail.com on 18 Nov 2009 at 5:40

GoogleCodeExporter commented 9 years ago
I don't know very much about start script systems like init V or the more recent
upstart. Below is a small Python script to test what works in rc.local and what 
not.
You could experiment with it by commenting out some parts and by starting it in
rc.local directly and/or with '... > /some/where 2&1'.

#!/usr/bin/python

# write to a file in root's home:
fp = open("/root/log.tmp", 'w')
fp.write("hello log\n")
fp.close()

# write to standard out by dev:
fp = open("/dev/stdout", 'w')
fp.write("hello dev-stdout\n")
fp.close()

# write to standard out with print:
print("hello stdout")

Original comment by obensonne@googlemail.com on 18 Nov 2009 at 8:40

GoogleCodeExporter commented 9 years ago

Original comment by obensonne@googlemail.com on 22 Nov 2009 at 11:18

GoogleCodeExporter commented 9 years ago
Looks done ..

Original comment by obensonne@googlemail.com on 2 Dec 2009 at 8:51

GoogleCodeExporter commented 9 years ago
I had the same issue with remuco-amarok. Redirecting stderr output to stdout 
makes it
work. I used /etc/init.d/skeleton from Kubuntu for this and got exit status 0, 
but
the daemon wasn't running. Setting DAEMON_ARGS="2>&" resolved the problem. I 
also
added -u mylogin in the do_start() function trying to resolve it and it's 
probably a
good idea anyway. No log is available, ~/.cache/remuco/amarok/log contains
information only from previous manual runs.

Original comment by adrian.d...@gmail.com on 6 Dec 2009 at 6:04

GoogleCodeExporter commented 9 years ago

Original comment by obensonne@googlemail.com on 4 Jun 2010 at 6:31