![]() |
2007-10-27
, 14:30
|
|
Posts: 1,463 |
Thanked: 81 times |
Joined on Oct 2005
@ UK
|
#32
|
![]() |
2007-10-27
, 17:20
|
Posts: 474 |
Thanked: 30 times |
Joined on Jan 2006
|
#33
|
![]() |
2007-10-27
, 18:30
|
Posts: 76 |
Thanked: 19 times |
Joined on Apr 2007
|
#34
|
![]() |
2007-10-27
, 18:40
|
|
Posts: 1,137 |
Thanked: 402 times |
Joined on Sep 2007
@ Catalunya
|
#35
|
![]() |
2007-10-27
, 19:26
|
|
Posts: 1,137 |
Thanked: 402 times |
Joined on Sep 2007
@ Catalunya
|
#36
|
Additionally it seems that mencoder picked the second language instead of the first one, but I'll have to check more carefully if that's really the case.
![]() |
2007-10-27
, 19:47
|
Posts: 76 |
Thanked: 19 times |
Joined on Apr 2007
|
#37
|
#!/bin/sh ### BEGIN INIT INFO # Provides: mediaservd # Required-Start: $network $remote_fs $syslog # Required-Stop: $network $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start mediaservd daemon ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin . /lib/lsb/init-functions NAME=mediaservd DAEMON=/usr/local/bin/mediaserv test -x $DAEMON || exit 5 RUNASUSER=user UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true case $1 in start) log_daemon_msg "Starting mediaservd server" "mediaservd" if [ -z "$UGID" ]; then log_failure_msg "user \"$RUNASUSER\" does not exist" exit 1 fi su -l $RUNASUSER -c mediaserv log_end_msg $? ;; stop) log_daemon_msg "Stopping mediaservd server" "mediaservd" killall mediaserv log_end_msg $? ;; restart|force-reload) $0 stop && sleep 2 && $0 start ;; try-restart) if $0 status >/dev/null; then $0 restart else exit 0 fi ;; reload) exit 3 ;; status) ps -fu $RUNASUSER | grep mediaserv >>/dev/null status=$? if [ $status -eq 0 ]; then log_success_msg "mediaservd server is running." else log_failure_msg "mediaservd server is not running." fi exit $status ;; *) echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" exit 2 ;; esac
![]() |
2007-10-27
, 20:00
|
Posts: 76 |
Thanked: 19 times |
Joined on Apr 2007
|
#38
|
![]() |
2007-10-27
, 22:09
|
|
Posts: 1,463 |
Thanked: 81 times |
Joined on Oct 2005
@ UK
|
#39
|
![]() |
2007-10-27
, 22:23
|
|
Posts: 98 |
Thanked: 189 times |
Joined on Jul 2007
@ San Antonio, TX
|
#40
|
$ip = `tracepath google.com | head -n 1 | awk '{ print \$2 }'`;
Installed activestate, check.
ppm install xml::rss, check.
Got unxutils, check.
Gotta copy of mplayer + mencoder in the path and checked 770-encode works, check.
All good so far...
All paths set, setup a $home path and started mediaserv....
Little bit of reading around - I saw where you got the idea for the server daemon and was hoping to understand unix processes and p'raps change things to suit a win32 environment.
No chance of that happening anytime soon - need to learn Perl and need to re-learn unix processes to understand what needs to be done, lol. I scoured online for a bit and foudn that Setsid and the like aren't ever going to have a win32 equivelant...oh well.
From what little I do know - does all this setting of PIDs really matter in the Win32 world? I don't care for a daemon yet - initially let's get this running from the command line and then perhaps transfer things to Win32:
So anyways . . . . comment out lines 576 and 498, and fix various paths to mediaserv.log (remove /tmp/ ) and see what we get.
[code]
mediaserv running at http://reaper:8090
Parent daemon running.[code]
Good stuff....
Go visit http://reaper:8090....browser sits there doing nothing. Hmmmmm.
Refresh page. Refresh page. Refresh page...
Check logs:
[code]
2007/10/26 23:36:52 -3448 - NOTE! forked new child, we now have 1 children
2007/10/26 23:37:00 -3448 - NOTE! forked new child, we now have 2 children
2007/10/26 23:37:26 -3448 - NOTE! forked new child, we now have 3 children
2007/10/26 23:37:26 -3192 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:26 -3192 - disconnect:192.168.1.100 - ct[1]
2007/10/26 23:37:51 -2500 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:51 -2500 - disconnect:192.168.1.100 - ct[1]
2007/10/26 23:37:51 -1996 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:51 -1996 - disconnect:192.168.1.100 - ct[1]
[code]
Well - stuff is happening. I think.
I noticed it reading files from a /static/ directory - this seemed to cause hangups. Copied /resources/ to /static/ and hurrah! Stuff is showing up in the browser now
But erm - selecting various directories, etc and it's still playing up... I kinda understand the reasons for disassociating from the controlling terminal when daemonizing a server - but atm I just want this running in the current term. fork() should work ok in activestate so I wonder why its screwing up.
Or maybe this is a chance to just stick with Ubuntu
[Dammit - if I can find a working mencoder for the NSLU2 I'd set it up there!]