LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Conky: problems displaying output from certain scripts or commands (http://www.linuxquestions.org/questions/linux-software-2/conky-problems-displaying-output-from-certain-scripts-or-commands-753656/)

zymos 09-08-2009 03:57 PM

Conky: problems displaying output from certain scripts or commands
 
1 Attachment(s)
I have problems displaying the output of a of a script i wrote, and executing certain commands. I dont think it has anything to do with the script itself.

See attached image for how the conky's display looks funky

The line that's runs the script is
${execi 300 /usr/scripts/simple-rss-reader-v3.pl}

I also get display problems when running the command
${execi 30 tail -n5 /var/log/messages | fold -w70}

While conky is running with the line 'tail -n5 /var/log/messages' inserted i get these error. It seems sh is trying to execute the output of 'tail -n5 /var/log/messages | fold -w70'. See below for the output of 'tail -n5 /var/log/messages | fold -w70' in shell
sh: n/ru: No such file or directory
sh: -c: line 1: syntax error near unexpected token `)'
sh: -c: line 1: `n-crons && /usr/sbin/run-crons )'
sh: n/ru: No such file or directory


I noticed that when i killall conky, i get this error when i have simple-rss-reader-v3.pl in conkyrc
*** glibc detected *** conky: free(): invalid next size (normal)
And when i have 'tail -n5 /var/log/messages | fold -w70' in conkyrc i get this error
*** glibc detected *** conky: double free or corruption
but when these are removed i get no error. See below for full error outputs


I get no errors or display problems with the following
${execi 30 tail -n3 /var/log/Xorg.0.log | fold -w70}
${execi 120 dmesg | tail -n5 | fold -w70}


I have tried to attach as much as posible, to help in debuging

#####################################################
## Code and Configs
##

My conkyrc
Code:

##############################################
#  My Conky configy
#
#

maximum_width 350
own_window yes
own_window_transparent no
own_window_colour black
own_window_type desktop
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft no

# Update interval in seconds
update_interval 3.0

# Minimum size of text area
# minimum_size 250 5

# Draw shades?
draw_shades no

# Text stuff
draw_outline no
        # amplifies text if yes
draw_borders no
uppercase no
        # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey
# black

# Text alignment, other possible values are commented
#alignment top_left
# alignment top_right
alignment bottom_left
# alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 10

# stuff after 'TEXT' will be formatted on screen
# ${color orange}boinc output ${hr 2}
# ${execi 30 tail -n7 /tmp/boinc_log| fold -w45}
#${color gray}Down: ${downspeed wlan0} k/s ${alignr}Up: ${upspeed wlan0} k/s
#${downspeedgraph wlan0 25,115 000000 ff0000} ${alignr}${upspeedgraph wlan0 25,115 000000 00ff00}
#${color gray}# Total: ${totaldown wlan0} ${alignr}Total: ${totalup wlan0}


TEXT
${color orange}${hr 2}
${color orange}SYSTEM ${hr 2}
${color gray}${time %e %B %G} - ${execi 3600 /usr/scripts/weather-forcast.sh 80303}

${color orange}RSS feed ${hr 2}${color gray}
${execi 300 /usr/scripts/simple-rss-reader-v3.pl}

${color orange}CPU ${hr 2}
${color gray}${freq}MHz  Load: ${loadavg} 
$cpubar
${cpugraph 000000 ffffff}
${color gray}NAME                PID    CPU%  MEM%
${color gray}${top name 1} ${top pid 1}  ${top cpu 1}  ${top mem 1}
${color gray}${top name 2} ${top pid 2}  ${top cpu 2}  ${top mem 2}
${color gray}${top name 3} ${top pid 3}  ${top cpu 3}  ${top mem 3}
${color gray}${top name 4} ${top pid 4}  ${top cpu 4}  ${top mem 4}
${color gray}
${color orange}MEMORY / DISK ${hr 2}
${color gray}RAM:  $memperc%  ${membar 6}
${color gray}
${color gray}Root:  ${fs_free_perc /}%  ${fs_bar 6 /}
${color gray}
${color orange}NETWORK (${addr eth0}) ${hr 2}
${color gray}Down: ${downspeed eth0} k/s ${alignr}Up: ${upspeed eth0} k/s
${downspeedgraph eth0 25,115 000000 ff0000} ${alignr}${upspeedgraph eth0
25,115 000000 00ff00}
${color gray}Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0}
${color orange}${hr 2}



The simple-rss-reader-v3.pl scripts code is
Code:

#!/usr/bin/perl -w

############################
# Creator: Jeff Israel
#
# Script:        ./simple-rss-reader-v3.pl
# Version:        3.002
#
# Coded for for Wikihowto http://howto.wikia.com
#
# Description:        This code downloads an RSS feed,
#                extracts the <title> lines,
#                cleans them up lines,
#                prints the pretty lines
#                exits on max-lines
# Usage:
# .conkyrc: ${execi [time] /path/to/script/simple-rss-reader-v3.pl}
#
# Usage Example
# ${execi 300 /path/to/script/simple-rss-reader-v3.pl}
#

use LWP::Simple qw($ua get);
$ua->timeout(30);

############################
# Configs
#

#$rssPage = "http://tvrss.net/feed/combined/";
$rssPage = 'http://twitter.com/statuses/user_timeline/37039456.rss';
# $rssPage = "http://tvrss.net/feed/eztv/";
$numLines = 10;
$maxTitleLenght = 35;

###########################
# Code
#

# Downloading RSS feed
my $pageCont = get($rssPage);

# Spliting the page to lines
@pageLines = split(/\n/,$pageCont);

# Parse each line, strip no-fun data, exit on max-lines
$numLines--; #correcting count for loop
$x = 0;
foreach $line (@pageLines) {
        if($line =~ /\<title\>/){ # Is a good line?
                #print "- $line\n";
                $lineCat = $line;
                $lineCat =~ s/.*\<title\>//;
                $lineCat =~ s/\<\/title\>.*//;
                $lineCat =~ s/\[.{4,25}\]$//; # strip no-fun data ( [from blaaa] )

                #some optional substitutions/removal
                $lineCat =~ s/eztv_it: //;

                $lineCat = substr($lineCat, 0, $maxTitleLenght);
                print "- $lineCat \n";
                $x++;
        }
        if($x > $numLines) {
                last; #exit on max-lines
        }
       
}

#print $page;
#print "\nBy Bye\n";


################################################################
## Commands/scripts output in shell
##

simple-rss-reader-v3.pl output in shell is
Code:

- Twitter / eztv_it
- Defying Gravity S01E07 HDTV XviD-No
- Big Brother UK S10E107 The Final Pa
- Flying Confessions of a Free Woman 
- The Sci Fi Guys S03E16 Kaj Erik Eri
- BBC Future of Food 2of3 Senegal Xvi
- BBC This World Gypsy Child Thieves 
- BBC Coast And Beyond Series 4 5of8 
- New Tricks 6x08 (PDTV-FoV)[VTV] - h
- Flying Confessions of a Free Woman



Output of 'tail -n5 /var/log/messages | fold -w70'
Code:

Sep  8 14:00:01 localhost cron[8188]: (root) CMD (test -x /usr/sbin/ru
n-crons && /usr/sbin/run-crons )
Sep  8 14:10:01 localhost cron[8223]: (root) CMD (test -x /usr/sbin/ru
n-crons && /usr/sbin/run-crons )
Sep  8 14:20:01 localhost cron[8255]: (root) CMD (test -x /usr/sbin/ru
n-crons && /usr/sbin/run-crons )
Sep  8 14:30:01 localhost cron[8379]: (root) CMD (test -x /usr/sbin/ru
n-crons && /usr/sbin/run-crons )
Sep  8 14:40:01 localhost cron[8685]: (root) CMD (test -x /usr/sbin/ru
n-crons && /usr/sbin/run-crons )




###################################################
## Conky stout/sterr after being killed
##


Conky stout/sterr with simple-rss-reader-v3.pl line, after killall conky
Code:

Conky: window type - desktop
Conky: drawing to created window (0x600002)
Conky: drawing to double buffer
killall conky
Conky: received SIGINT or SIGTERM to terminate. bye!
*** glibc detected *** conky: free(): invalid next size (normal): 0x0000000000648fb0 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f32d4baf468]
/lib/libc.so.6(cfree+0x76)[0x7f32d4bb0fa6]
conky[0x4111c7]
conky[0x4113f0]
conky[0x419306]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f32d4b5a5c6]
conky[0x404dd9]
======= Memory map: ========
00400000-00429000 r-xp 00000000 08:03 2647050                            /usr/bin/conky
00628000-00629000 r--p 00028000 08:03 2647050                            /usr/bin/conky
00629000-0062a000 rw-p 00029000 08:03 2647050                            /usr/bin/conky
0062a000-0067b000 rw-p 00000000 00:00 0                                  [heap]
7f32d0000000-7f32d0021000 rw-p 00000000 00:00 0
7f32d0021000-7f32d4000000 ---p 00000000 00:00 0
7f32d4926000-7f32d493b000 r-xp 00000000 08:03 1334888                    /lib64/libgcc_s.so.1
7f32d493b000-7f32d4b3a000 ---p 00015000 08:03 1334888                    /lib64/libgcc_s.so.1
7f32d4b3a000-7f32d4b3b000 r--p 00014000 08:03 1334888                    /lib64/libgcc_s.so.1
7f32d4b3b000-7f32d4b3c000 rw-p 00015000 08:03 1334888                    /lib64/libgcc_s.so.1
7f32d4b3c000-7f32d4c87000 r-xp 00000000 08:03 2761440                    /lib64/libc-2.9.so
7f32d4c87000-7f32d4e87000 ---p 0014b000 08:03 2761440                    /lib64/libc-2.9.so
7f32d4e87000-7f32d4e8b000 r--p 0014b000 08:03 2761440                    /lib64/libc-2.9.so
7f32d4e8b000-7f32d4e8c000 rw-p 0014f000 08:03 2761440                    /lib64/libc-2.9.so
7f32d4e8c000-7f32d4e91000 rw-p 00000000 00:00 0
7f32d4e91000-7f32d4e93000 r-xp 00000000 08:03 2762381                    /lib64/libdl-2.9.so
7f32d4e93000-7f32d5093000 ---p 00002000 08:03 2762381                    /lib64/libdl-2.9.so
7f32d5093000-7f32d5094000 r--p 00002000 08:03 2762381                    /lib64/libdl-2.9.so
7f32d5094000-7f32d5095000 rw-p 00003000 08:03 2762381                    /lib64/libdl-2.9.so
7f32d5095000-7f32d509a000 r-xp 00000000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f32d509a000-7f32d5299000 ---p 00005000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f32d5299000-7f32d529a000 r--p 00004000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f32d529a000-7f32d529b000 rw-p 00005000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f32d529b000-7f32d529d000 r-xp 00000000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f32d529d000-7f32d549c000 ---p 00002000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f32d549c000-7f32d549d000 r--p 00001000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f32d549d000-7f32d549e000 rw-p 00002000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f32d549e000-7f32d559c000 r-xp 00000000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f32d559c000-7f32d579b000 ---p 000fe000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f32d579b000-7f32d579d000 r--p 000fd000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f32d579d000-7f32d57a2000 rw-p 000ff000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f32d57a2000-7f32d57b6000 r-xp 00000000 08:03 263196                    /lib64/libz.so.1.2.3
7f32d57b6000-7f32d59b5000 ---p 00014000 08:03 263196                    /lib64/libz.so.1.2.3
7f32d59b5000-7f32d59b6000 r--p 00013000 08:03 263196                    /lib64/libz.so.1.2.3
7f32d59b6000-7f32d59b7000 rw-p 00014000 08:03 263196                    /lib64/libz.so.1.2.3
7f32d59b7000-7f32d5a42000 r-xp 00000000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f32d5a42000-7f32d5c42000 ---p 0008b000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f32d5c42000-7f32d5c47000 r--p 0008b000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f32d5c47000-7f32d5c48000 rw-p 00090000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f32d5c48000-7f32d5c6d000 r-xp 00000000 08:03 3626889                    /usr/lib64/libexpat.so.1.5.2
7f32d5c6d000-7f32d5e6d000 ---p 00025000 08:03 3626889                    /usr/[2]+  Aborted                conky -c .conkyrc



Conky stout/sterr with 'tail -n5 /var/log/messages | fold -w70' line inserted, after killall conky
Code:

Conky: window type - desktop
Conky: drawing to created window (0x600002)
Conky: drawing to double buffer
sh: n/ru: No such file or directory
sh: -c: line 1: syntax error near unexpected token `)'
sh: -c: line 1: `n-crons && /usr/sbin/run-crons )'
killall conky
Conky: received SIGINT or SIGTERM to terminate. bye!
*** glibc detected *** conky: double free or corruption (!prev): 0x000000000064a290 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f448f4ae468]
/lib/libc.so.6(cfree+0x76)[0x7f448f4affa6]
conky[0x4111c7]
conky[0x4113f0]
conky[0x419306]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f448f4595c6]
conky[0x404dd9]
======= Memory map: ========
00400000-00429000 r-xp 00000000 08:03 2647050                            /usr/bin/conky
00628000-00629000 r--p 00028000 08:03 2647050                            /usr/bin/conky
00629000-0062a000 rw-p 00029000 08:03 2647050                            /usr/bin/conky
0062a000-0067a000 rw-p 00000000 00:00 0                                  [heap]
7f4488000000-7f4488021000 rw-p 00000000 00:00 0
7f4488021000-7f448c000000 ---p 00000000 00:00 0
7f448f225000-7f448f23a000 r-xp 00000000 08:03 1334888                    /lib64/libgcc_s.so.1
7f448f23a000-7f448f439000 ---p 00015000 08:03 1334888                    /lib64/libgcc_s.so.1
7f448f439000-7f448f43a000 r--p 00014000 08:03 1334888                    /lib64/libgcc_s.so.1
7f448f43a000-7f448f43b000 rw-p 00015000 08:03 1334888                    /lib64/libgcc_s.so.1
7f448f43b000-7f448f586000 r-xp 00000000 08:03 2761440                    /lib64/libc-2.9.so
7f448f586000-7f448f786000 ---p 0014b000 08:03 2761440                    /lib64/libc-2.9.so
7f448f786000-7f448f78a000 r--p 0014b000 08:03 2761440                    /lib64/libc-2.9.so
7f448f78a000-7f448f78b000 rw-p 0014f000 08:03 2761440                    /lib64/libc-2.9.so
7f448f78b000-7f448f790000 rw-p 00000000 00:00 0
7f448f790000-7f448f792000 r-xp 00000000 08:03 2762381                    /lib64/libdl-2.9.so
7f448f792000-7f448f992000 ---p 00002000 08:03 2762381                    /lib64/libdl-2.9.so
7f448f992000-7f448f993000 r--p 00002000 08:03 2762381                    /lib64/libdl-2.9.so
7f448f993000-7f448f994000 rw-p 00003000 08:03 2762381                    /lib64/libdl-2.9.so
7f448f994000-7f448f999000 r-xp 00000000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f448f999000-7f448fb98000 ---p 00005000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f448fb98000-7f448fb99000 r--p 00004000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f448fb99000-7f448fb9a000 rw-p 00005000 08:03 41261                      /usr/lib64/libXdmcp.so.6.0.0
7f448fb9a000-7f448fb9c000 r-xp 00000000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f448fb9c000-7f448fd9b000 ---p 00002000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f448fd9b000-7f448fd9c000 r--p 00001000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f448fd9c000-7f448fd9d000 rw-p 00002000 08:03 1529645                    /usr/lib64/libXau.so.6.0.0
7f448fd9d000-7f448fe9b000 r-xp 00000000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f448fe9b000-7f449009a000 ---p 000fe000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f449009a000-7f449009c000 r--p 000fd000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f449009c000-7f44900a1000 rw-p 000ff000 08:03 1536456                    /usr/lib64/libX11.so.6.2.0
7f44900a1000-7f44900b5000 r-xp 00000000 08:03 263196                    /lib64/libz.so.1.2.3
7f44900b5000-7f44902b4000 ---p 00014000 08:03 263196                    /lib64/libz.so.1.2.3
7f44902b4000-7f44902b5000 r--p 00013000 08:03 263196                    /lib64/libz.so.1.2.3
7f44902b5000-7f44902b6000 rw-p 00014000 08:03 263196                    /lib64/libz.so.1.2.3
7f44902b6000-7f4490341000 r-xp 00000000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f4490341000-7f4490541000 ---p 0008b000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f4490541000-7f4490546000 r--p 0008b000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f4490546000-7f4490547000 rw-p 00090000 08:03 2127683                    /usr/lib64/libfreetype.so.6.3.20
7f4490547000-7f449056c000 r-xp 00000000 08:03 3626889                    /usr/lib64/libexpat.so.1.5.2
7f449056c000-7f449076c000 ---p 00025000 08:03 3626889                    /usr/lib64/libexpat.so.1.5.2
7f449076c000-7f449076e000 r--p 00025000 08:03 3626889                    /usr/lib64/libexpat.so.1.5.2
7f449076e000-7f449076f000 rw-p 00027000 08:03 3626889                    /usr/lib64/libexpat.so.1.5.2
7f449076f000-7f449079c000 r-xp 00000000 08:03 41012                      /usr/lib64/libfontconfig.so.1.3.0
7f449079c000-7f449099c000 ---p 0002d000 08:03 41012                      /usr/lib64/libfontconfig.so.1.3.0
7f449099c000-7f449099d000 r--p 0002d000 08:03 41012                      /usr/lib64/libfontconfig.so.1.3.0
7f449099d000-7f449099e000 rw-p 0002e000 08:03 41012                      /usr/lib64/libfontconfig.so.1.3.0
7f449099e000-7f44909a7000 r-xp 00000000 08:03 411767                    /usr/lib64/libXrender.so.1.3.0
7f44909a7000-7f4490ba6000 ---p 00[1]+  Aborted                conky -c .conkyrc2

Conky stout/sterr with simple-rss-reader-v3.pl and 'tail -n5 /var/log/messages | fold -w70' lines removed, after killall conky
Code:

Conky: window type - desktop
Conky: drawing to created window (0x600002)
Conky: drawing to double buffer
killall conky
Conky: received SIGINT or SIGTERM to terminate. bye!
[1]+  Done                    conky -c .conkyrc


zymos 09-10-2009 05:59 PM

Version info:

Conky 1.6.1 compiled Tue Aug 18 22:15:06 MDT 2009 for Linux 2.6.30-gentoo (x86_64)

Compiled in features:

System config file: /etc/conky/conky.conf

X11:
* Xdamage extension
* Xdbe extension (double buffer)
* xft

Music detection:

General features:
* math


All times are GMT -5. The time now is 03:54 AM.