What's new

Scribe scribe - syslog-ng and logrotate installer

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I'm starting to think it's because I'm overwriting the script while it's running and it's doing funky things?
Likely I'd guess. I just checked everything I can think of and all running normally and smoothy. (shrug)
 
Likely I'd guess. I just checked everything I can think of and all running normally and smoothy. (shrug)

I'm teetering, I'm on the edge now.

Okay, going to my router now and going to try this after some lunch! :eek::D
 
v0.8_1 pushed

* (Hopefully) fixes an issue where continuing the script after upgrading causes spurious error messages
Yes, I think so, no errors this time.
Code:
syslog-ng and logrotate installation 
     v0.8_0 (master)  Coded by cynicastic 
         scribe installed version: v0.8_0 
            scribe GitHub version: v0.8_1 
 New version available!
 Do you wish to upgrade [y|n] y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    293      0 --:--:-- --:--:-- --:--:--   403
100 15762    0 15762    0     0  17151      0 --:--:-- --:--:-- --:--:-- 17151
Archive:  /opt/tmp/scribe.zip
   creating: scribe-master/
  inflating: scribe-master/.gitattributes
  inflating: scribe-master/.gitignore
  inflating: scribe-master/README.md
   creating: scribe-master/init.d/
  inflating: scribe-master/init.d/rc.func.syslog-ng
   creating: scribe-master/logrotate.d/
  inflating: scribe-master/logrotate.d/A00global
  inflating: scribe-master/logrotate.d/crash
  inflating: scribe-master/logrotate.d/messages
  inflating: scribe-master/logrotate.d/syslogng
   creating: scribe-master/logrotate.share/
  inflating: scribe-master/logrotate.share/openvpn
  inflating: scribe-master/logrotate.share/pixelsrv
  inflating: scribe-master/scribe
   creating: scribe-master/syslog-ng.d/
  inflating: scribe-master/syslog-ng.d/crashes
  inflating: scribe-master/syslog-ng.d/syslogng
  inflating: scribe-master/syslog-ng.d/wlceventd
   creating: scribe-master/syslog-ng.share/
  inflating: scribe-master/syslog-ng.share/expandlog
  inflating: scribe-master/syslog-ng.share/openvpn
  inflating: scribe-master/syslog-ng.share/pixelserv
  inflating: scribe-master/syslog-ng.share/skynet
  inflating: scribe-master/syslog-ng.share/syslog-ng.conf-no_scl
Downloading http://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
 setting up scribe ... done. 
 Do you want to update syslog-ng and logrotate example and installed (/opt/etc/*.d/) files? [y|n] y

username@RT-AC86U-4608:/tmp/home/root#
 
v0.8_1 pushed

* (Hopefully) fixes an issue where continuing the script after upgrading causes spurious error messages
Oh for crying in the beer! Fix one problem, create another.

V0.8_2 is now up. WARNING: due to a logic error in 0.8_1, if you update the script from 0.8_1, it will also update the example and installed files. Sorry. Message to follow on how to avoid this.
 
Oh for crying in the beer! Fix one problem, create another.

V0.8_2 is now up. WARNING: due to a logic error in 0.8_1, if you update the script from 0.8_1, it will also update the example and installed files. Sorry. Message to follow on how to avoid this.
I used FileZilla and backed up the full USB stick first, then updated. Comparing directories, sizes and timestamps, none of my files in use changed. It is running smoooooove! :cool:
 
Loggly is sweet! Thanks @elorimer for the help getting it going and on scribe as well!

screenshot-timsaw-loggly-com-2019-04-07-21-23-48.png
 
Oh for crying in the beer! Fix one problem, create another.

V0.8_2 is now up. WARNING: due to a logic error in 0.8_1, if you update the script from 0.8_1, it will also update the example and installed files. Sorry. Message to follow on how to avoid this.
I though I could be extra clever and come up with a fancy sed string that would fix it. Also, my regex-fu is weak. To keep from accidentally overwriting your files, in the v8.0_1 script, you need to look for the line that is:
Code:
[ "$inst" = "yes" ] && menu_filters
which should be line 367, and replace it with:
Code:
[ "$upd" = "yes" ] && menu_filters
Again, sorry.[/CODE]
 
Last edited:
I though I could be extra clever and come up with a fancy sed string that would fix it. Also, my regex-fu is weak. You need to look for the line that is:
Code:
[ "$inst" = "yes" ] && menu_filters
[CODE]
which should be line 367, and replace it with:
[CODE]
[ "$upd" = "yes" ] && menu_filters
[CODE]
Again, sorry.

Ok, I get nervous in scripts since i do not read them well. I found the "$inst" code, this is what I see and replaced, before I copy it back, is this correct?
Code:
if [ "$upd" = "yes" ]  <<== this is line 367
    then
        getzip
        setup_scribe
        printf "\n$white $scribe_name updated!$std\n"
        [ $upd = "yes" ] && scribe filters gotzip
        exit 0
    else
        printf "\n$white $scribe_name$red not$white updated!$std\n"
    fi
    if [ "$upd" = "yes" ]
    then
        menu_filters
        printf "\n$white %s and %s example and installed files updated!$std\n" "$sng" "$lr"
    else
        printf "\n$white %s and %s example and installed files$red not$white updated!$std\n" "$sng" "$lr"
    fi
 
Last edited:
The test command for syslog-ng is really helpful, and looking through the output is educational. This is the line that @elorimer shared from @Martineau earlier.
Code:
syslog-ng -d
Here is something interesting at the start that you might want to see, not sure if it is really important or not, The output is much longer, there are the first lines.
Code:
/tmp/home/root# syslog-ng -d
[2019-04-07T21:51:36.853044] nanosleep() is not accurate enough to introduce minor stalls on the reader side, multi-threaded performance may be affected;
[2019-04-07T21:51:36.853949] Processing @include statement; filename='/opt/etc/syslog-ng.d/', include-path='/opt/etc:/opt/share/syslog-ng/include'
[2019-04-07T21:51:36.854181] Adding include file; filename='wlceventd', depth='1'
[2019-04-07T21:51:36.854317] Adding include file; filename='crashes', depth='1'
[2019-04-07T21:51:36.854408] Adding include file; filename='0loggly', depth='1'
[2019-04-07T21:51:36.854565] Adding include file; filename='openvpn', depth='1'
[2019-04-07T21:51:36.854656] Adding include file; filename='pixelserv', depth='1'
[2019-04-07T21:51:36.854812] Adding include file; filename='ethernet', depth='1'
[2019-04-07T21:51:36.854902] Adding include file; filename='vpnfailover', depth='1'
[2019-04-07T21:51:36.855058] Adding include file; filename='syslogng', depth='1'
[2019-04-07T21:51:36.855135] Skipping include file, it cannot begin with .; filename='.keep'
[2019-04-07T21:51:36.855290] Adding include file; filename='chkwan', depth='1'
[2019-04-07T21:51:36.855380] Adding include file; filename='skynet', depth='1'
[2019-04-07T21:51:36.855600] Starting to read include file; filename='/opt/etc/syslog-ng.d/0loggly', depth='1'
[2019-04-07T21:51:36.856613] Reading path for candidate modules; path='/opt/lib/syslog-ng'
[2019-04-07T21:51:36.856700] Reading shared object for a candidate module; path='/opt/lib/syslog-ng', fname='libbasicfuncs.so', module='basicfuncs'
This one caught my eye with the earlier discussion about the .keep file.
Code:
Skipping include file, it cannot begin with .; filename='.keep'
 
Ok, I get nervous in scripts since i do not read them well. I found the "$inst" code, this is what I see and replaced, before I copy it back, is this correct?
Code:
if [ "$upd" = "yes" ]  <<== this is line 367
    then
        getzip
        setup_scribe
        printf "\n$white $scribe_name updated!$std\n"
        [ $upd = "yes" ] && scribe filters gotzip
        exit 0
    else
        printf "\n$white $scribe_name$red not$white updated!$std\n"
    fi
    if [ "$upd" = "yes" ]
    then
        menu_filters
        printf "\n$white %s and %s example and installed files updated!$std\n" "$sng" "$lr"
    else
        printf "\n$white %s and %s example and installed files$red not$white updated!$std\n" "$sng" "$lr"
    fi
No, you only needed to change the line in 0.8_1.

0.8_2 is already fixed.

I clarified the instructions above.
 
No, you only needed to change the line in 0.8_1.

0.8_2 is already fixed.

I clarified the instructions above.
Okay, it's past bedtime here, gotta go to work tomorrow. 0.8_2 now doesn't update the example & *.d files if you try to do it as part of upgrading scribe. It won't run the new script from inside the old, although I've tried a couple methods. I'll have to bang on it some more later. For now, it's plenty usable, calling 'scribe update-filters' will update the example & *.d files once you've installed the new script.
 
Okay, it's past bedtime here, gotta go to work tomorrow. 0.8_2 now doesn't update the example & *.d files if you try to do it as part of upgrading scribe. It won't run the new script from inside the old, although I've tried a couple methods. I'll have to bang on it some more later. For now, it's plenty usable, calling 'scribe update-filters' will update the example & *.d files once you've installed the new script.
Yes, time for bed for me too. Thanks for the time to update so much of the script, it really is good after my own foul ups early on. As I have stated before, I have tried off and on for year to get syslog-ng running. That time length shows I really am a script dunce. :D :p o_O
 
Yes, time for bed for me too. Thanks for the time to update so much of the script, it really is good after my own foul ups early on. As I have stated before, I have tried off and on for year to get syslog-ng running. That time length shows I really am a script dunce. :D :p o_O
Actually, nevermind, 8.0_2 works just fine. PEBKAC (Problem Exists Between Keyboard And Chair).
 
I'm in the pool. ;)

ScribeAlive2019-04-07-FirstInstall.PNG


Running on an RT-AC86U Powered by RMerlin 384.10_2.

Now what? :oops:

I'll be re-reading this whole thread now! :p
 
If you haven't already, I recommend integrating Codacy and/or TravisCI to monitor your script using shellcheck. They can help catch potential errors before a user does!
 
This one caught my eye with the earlier discussion about the .keep file.
Code:
Skipping include file, it cannot begin with .; filename='.keep'
This isn't a problem. The .keep file is a zero length file to populate the syslog-ng.d directory. Generally empty directories aren't copied, I understand, so without it the installer wouldn't create the directory. You can delete it or ignore the error.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top