Page 1 of 1

use of cat command

PostPosted: Wed Aug 20, 2014 12:09 pm
by bri_tal
Could someone please tell me how to list the applications currently running, using the 'cat' command

Re: use of cat command

PostPosted: Wed Aug 20, 2014 2:38 pm
by nick1austin
Seems like a strange thing to do.

You can get the ps command from here:
http://194.1.151.205/tivo-static/softwa ... .1/devbin/

'ps a' will list all tasks.
'ps u' gives additional detail about each task.

Re: use of cat command

PostPosted: Wed Aug 20, 2014 3:04 pm
by nick1austin
Once you have a process number (pid) you can use cat to get additional details.

For example for process 283:
cat /proc/283/environ

Re: use of cat command

PostPosted: Wed Aug 20, 2014 3:20 pm
by bri_tal
Here is the output of the ps a command

Code: Select all
[TiVo [p0] ~]# ps a
  PID TTY STAT TIME COMMAND
  411  p0 S    0:00 /bin/bash -login
  425  p0 R    0:00 ps a
[TiVo [p0] ~]#


and

Here is the output of the cat command

Code: Select all
TiVo [p0] /bin]# cat /proc/411/environ
cat: /proc/411/environ: No such file or directory
[TiVo [p0] /bin]#


Doesn't tell me what tivo functions are currently in operation. I must be doing something wrong

Re: use of cat command

PostPosted: Wed Aug 20, 2014 7:53 pm
by mrtickle
there are many switches to ps, try googling 'man ps'

'ps auxf' gives more processes and even shows which are the parent processes of each. Here's my output, with some columns removed for brevity:

Code: Select all
 PID %CPU %MEM  STAT START   TIME COMMAND
   1 99.9  0.0  SW   19:48   0:01 init
   2  0.0  0.0  SW   19:48   0:14 (kflushd)
   3  0.0  0.0  RW   19:48   0:04 (kswapd)
  61 99.9  1.1  S    19:53   0:41 update (bdflush)
  69 99.9  1.8  S    19:53  28:48 syslogd -p /var/dev/log -m 720
  71 99.9  0.0  SW   19:48   0:52 klogd
  79 99.9  0.0  SW   19:48   2:48 EventSwitcher
  80 99.9  2.9  S    19:53  38:06  \_ MfsDaemon
 108 24.0  0.0  SW   19:48   0:00  \_ Sark (mcp)
 112 99.9  2.0  S    19:53   0:46  |   \_ Sark (mcp)
 113 99.9  0.0  SW   19:48   0:41  |       \_ PipeListen
 114 99.9  0.0  SW   19:48   1:47  |       \_ Mcp event
 115  7.0  0.0  SW   19:48   0:00  \_ tcphonehome
 141  3.0  0.0  SW   19:48   0:00  |   \_ tcphonehome
 142 99.9  0.0  SW   19:48   0:45  |       \_ PipeListener
 143  1.0  0.0  SW   19:48   0:00  |       \_ FsMpStream
 144 99.9  0.0  SW   19:48   0:25  |       \_ PhoneHome event hd
 159 56.0  0.0  SW   19:48   0:00  \_ dbgc-mcp
 160 99.9  7.8  R    19:54 132:53  |   \_ dbgc-mcp
 161 99.9  0.0  SW   19:48   0:46  |       \_ PipeListener
 162 58.0  0.0  SW   19:48   0:00  \_ MyWorld
 163 99.9 15.3  R    19:54   1:30      \_ MyWorld
 164 99.9  0.0  SW   19:48   0:19          \_ PipeListener
 165 99.9  0.0  SW   19:48   0:04          \_ FsMpStream
 166 99.9  0.0  SW   19:48   9:17          \_ EventLog event
 167 99.9  0.0  SW   19:48   0:06          \_ TmkSinkMixAud
 168 99.9  7.5  R    19:54   0:51          \_ UI Timer Heart
 169 99.9  0.0  SW   19:48   2:31          \_ TmkClipCache0
 170 99.9  9.1  S    19:54   1:14          \_ TmkClipCache1
 171 99.9 11.1  R    19:54 453:50          \_ TvMomMpegSink
 172  2.0  0.0  SW   19:48   0:00          \_ TvMomMpegSink
 173 99.9 10.1  R    19:54   2:02          \_ Mediaswitch0
 174 99.9  0.0  SW   19:48  51:02          \_ TvRecorder
 175 99.9 12.7  S    19:54  46:28          \_ TmkTaskManager
 176 99.9 14.2  R    19:54 3031:39          \_ Scheduler
 177 99.9 12.5  R    19:54  29:00          \_ Prioritizer
 178 99.9  0.0  SW   19:48 458:39          \_ ContextMgr eve
  81 99.9  1.0  S    19:53   0:07 fancontrol
 125 99.9  0.9  S    19:53   0:00 /var/hack/yac/yac -f 12 -b 5 -t 15
 129 99.9  1.6  S    19:53   0:01 /var/hack/etc/cron
 131 99.9  0.0  SW   19:48   0:46 /var/hack/autospace/osdcons
 138 99.9  8.4  R    19:53  15:13 tivosh /var/mfs_ftp/mfs_ftp.tcl 3105
 152 14.0  0.0  SW   19:48   0:00 /bin/bash
 156  5.0  0.0  SW   19:48   0:00 /sbin/tivoftpd
 158 45.0  0.0  SW   19:48   0:00 /sbin/tnlited 23 /bin/bash -login
4025 23.0  0.0  SW   19:48   0:00  \_ /bin/bash -login
4032 28.0  0.0  RW   19:48   0:00      \_ ps auxf
3275 99.9 18.1  R    00:47  16:23 tivosh /var/hack/tivoweb-tcl/httpd-tt
3308  0.0  6.6  S    01:09   0:10 /tvbin/tivosh /var/hack/endpad/endpad
3310 99.9  6.4  R    01:23  10:25 tivosh /var/hack/autospace/autospace.
~


HTH

Re: use of cat command

PostPosted: Wed Aug 20, 2014 8:18 pm
by bri_tal
Thanks MrT. What prompted my query, was the fact that I believed MFS_Ftp to be running but when I came to extract a show from TivoWeb (selecting VLC).
I received the message that MFS_FTP is not running. At the moment, I simply want to check out if this is really the case and I thought that there would be a cat command to confirm this.

Re: use of cat command

PostPosted: Wed Aug 20, 2014 9:55 pm
by mrtickle
Cool. To just check if it's running, you can pipe the output to grep so that only the lines that match will be displayed.

Code: Select all
ps ax | grep mfs

I get
Code: Select all
~ # ps ax | grep mfs
  138  ?  R   15:24 tivosh /var/mfs_ftp/mfs_ftp.tcl 3105 backgrounded
 4062  p1 SW   0:00 grep mfs

ie process 138 on my tivo is mfs_ftp

Re: use of cat command

PostPosted: Thu Aug 21, 2014 9:41 am
by bri_tal
Great, thanks for that. Does YOUR output tell tou that mfs_ftp is NOT running ?

Re: use of cat command

PostPosted: Thu Aug 21, 2014 11:26 am
by nick1austin
Not sure if this will help, but if you just want to transfer a ty file you can do that with newer versions of TivoWeb from the 'MfsStream' menu.

Re: use of cat command

PostPosted: Thu Aug 21, 2014 2:31 pm
by bri_tal
Hi Nick,

I am using TivoWebPlus version 2.1.b3 (UK-20120818) and can only find 'Extract' with 3 options for file type. I chose vlc but got the error message that mfs_ftp was not running. Can't find 'stream' menu

Re: use of cat command

PostPosted: Thu Aug 21, 2014 5:31 pm
by mrtickle
bri_tal wrote:Great, thanks for that. Does YOUR output tell tou that mfs_ftp is NOT running ?


It tells me that is IS running (on process 138). :)

Re: use of cat command

PostPosted: Thu Aug 21, 2014 7:14 pm
by bri_tal
mrtickle wrote:
bri_tal wrote:Great, thanks for that. Does YOUR output tell tou that mfs_ftp is NOT running ?


It tells me that is IS running (on process 138). :)
Well my output to the ps query is virtually the same as yours, apart from the proc no. but upon trying to extract a show (vlc format) tivo tells me msf_ftp is not currently running. (I can extract using ty)