The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,602 other followers

Archive for November 4th, 2016

How to use curl command with http/2 on MacOS X

Posted by jpluimers on 2016/11/04

Skip the built-in curl and directly go to the homebrew one:

$ brew update
$ brew upgrade
$ brew install curl --with-nghttp2

Source: How to use curl command with http/2 on MacOS X [WayBack]

via: Using cURL with HTTP/2 on Mac OS X #sysadmin #unix #apple #macos – Joe C. Hecht – Google+ [WayBack]

–jeroen

Posted in Apple, Home brew / homebrew, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, macOS 10.12 Sierra, OS X 10.9 Mavericks, Power User | Leave a Comment »

What runs logrotate in OpenSUSE 13.2?

Posted by jpluimers on 2016/11/04

Historically, on many systems, logrotate is being ran from a daily cron job. Many tutorials still presume that, for instance HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples.

I still thought it would and after writing On OpenSuSE, when adding Apache vhosts with their own log files don’t forget to update your logrotate configuration I was anxious to see when logrotate would run the second time.

So I tried finding it in the cron.daily and it wasn’t there.

OpenSuSE 13.2 changed how logrotate is inficated: from there on (including both Tumbleweed and LEAP) logrotate is ran from the systemd service:

logrotate is a systemd service in 13.2 (/usr/lib/systemd/system/logrotate.service) and it is run periodically by a systemd timer (not cron).

Have a look at /usr/lib/systemd/system/logrotate.timer and “man systemd.timer”.

You can view the status of the logrotate.timer that fires it every day:

systemctl status logrotate.timer

It triggers logrotate and reads the config in /etc/logrotate.conf for basic global settings and then files in /etc/logrotate.d/* for custom settings for specific files.

Which means you should not mess around with files in /etc/logrotate.d/ as each file there will be processed. So don’t leave around backup files ending in a tilde (~) or DEADJOE as it causes trouble:

Jul 07 00:00:02 revue logrotate[16121]: error: DEADJOE:5 lines must begin with a keyword or a filename (possibly in double quotes)
Jul 07 00:00:02 revue logrotate[16121]: error: DEADJOE:6 missing '{' after log files definition
Jul 07 00:00:02 revue logrotate[16121]: error: found error in file DEADJOE, skipping

There’s more you can do do debug logrotate behaviour

The below tips are all based on this thread: [Bug 913421] logrotate not running after update from 13.1 to 13.2

Show if the timer is there and counting:

# systemctl list-timers --all
NEXT                          LEFT          LAST                          PASSED    UNIT                         ACTIVATES
Fri 2016-07-08 00:00:00 CEST  5h 24min left Thu 2016-07-07 00:00:02 CEST  18h ago   logrotate.timer              logrotate.service
Fri 2016-07-08 17:51:53 CEST  23h left      Thu 2016-07-07 17:51:53 CEST  43min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service

2 timers listed.

Show the status of the logrotate service itself:

# systemctl status logrotate.service --full
● logrotate.service - Rotate log files
   Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-07-07 00:00:02 CEST; 18h ago
     Docs: man:logrotate(8)
           man:logrotate.conf(5)
  Process: 16121 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
 Main PID: 16121 (code=exited, status=1/FAILURE)

Jul 07 00:00:02 revue logrotate[16121]: error: DEADJOE:5 lines must begin with a keyword or a filename (possibly in double quotes)
Jul 07 00:00:02 revue logrotate[16121]: error: DEADJOE:6 missing '{' after log files definition
Jul 07 00:00:02 revue logrotate[16121]: error: found error in file DEADJOE, skipping
Jul 07 00:00:02 revue logrotate[16121]: error: skipping "/var/log/squidGuard/squidGuard.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
Jul 07 00:00:02 revue logrotate[16121]: compress_ext is /usr/bin/xz
Jul 07 00:00:02 revue logrotate[16121]: compress_ext was changed to .xz
Jul 07 00:00:02 revue systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Jul 07 00:00:02 revue systemd[1]: Failed to start Rotate log files.
Jul 07 00:00:02 revue systemd[1]: logrotate.service: Unit entered failed state.
Jul 07 00:00:02 revue systemd[1]: logrotate.service: Failed with result 'exit-code'.

The bottom lines are from journalctl -u logrotate which can show more information.

In this case, fixing both issues was easy: remove DEADJOE and correct the permissions on this empty directory:

# ls -al /var/log/squidGuard/
total 0
drwxrwx--- 1 squid squid   0 Jun 16 21:08 .
drwxr-xr-x 1 root  root  962 Jul  6 17:36 ..
# chmod 750 /var/log/squidGuard/
# ls -al /var/log/squidGuard/
total 0
drwxr-x--- 1 squid squid   0 Jun 16 21:08 .
drwxr-xr-x 1 root  root  962 Jul  6 17:36 ..

If you can’t wait for the timer to fire at midnight, you can invoke the logrotate service manually (after that wait until it is finished then do something like du -csh /var/log/* or list the files):

# systemctl start logrotate.service

–jeroen

via:

Posted in *nix, Linux, logrotate, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

Fritz!Box 7490 with fiber connection, routing anonymous/withheld ISDN calls to a new answering machine

Posted by jpluimers on 2016/11/04

I got a bit fed-up with truckloads of anonymous calls. 95% of these are from sales persons. The others from organisations shielding their phone numbers. Too bad for the latter: if they want to stay anonymous, they’re not worth dealing with.

My original setup was incoming ISDN connected through a Gigaset DX600A with a bunch of DECT handsets, but there you need to configure each handheld device and the Gigaset base station itself to skip anonymous incoming calls.

One of my fiber connections at home goes through a Fritz!Box 7490 which has a connector to provide an internal ISDN S0 bus. I discovered – though not advertised in the German or English manual – that you can hook it to external ISDN even though it is not connected to external DSL but external fiber to the home (FTTH).

A note first: the the Fritz!Box 7490 has built-in resistors to terminate the S0 bus, so it can only be on one side of the S0 bus. The other far end of the S0 bus needs to be terminated too.

Steps to hook up ISDN on both incoming and outgoing S0 bus:

  1. Fritz!Box Y-Cable for connecting PSTN or ISDN (and optionally DSL) to your modem.

    Fritz!Box Y-Cable for connecting PSTN or ISDN (and optionally DSL) to your modem.

    Put the long end of the Y-cable ** into the DSL/TEL connection of the Fritz!Box.
    The long end is usually labelled DSL/TEL.

  2. Put the black small end into your ISDN NT1 (sometimes called ISDN NTBA).
    The black small end is usually labelled TEL.
  3. Leave the grey small end disconnected. It is usually called DSL. Since I’m using FTTH, no DSL for me.
  4. Connect the chain of other ISDN devices (and the terminator) to the FON S0 connector on the Fritz!Box **.
  5. Test if your original equipment still works.

Configuring your Fritz!Box to use ISDN MSNs:

  1. Logon as administrator to your Fritz!Box.
  2. In the menu on the left, click on “Telephony”, then on “Telephone Numbers”.
  3. A new View appears, where you click on the “Line Settings” tab.
  4. Ensure “Landline network enabled” is enabled, then click on “Apply” and wait for the changes to be saved.
  5. In the menu on the left, click on “Telephony”, then on “Telephone Numbers”.
  6. Click on “New Telephone Number”, then follow the steps in the wizard:
    1. Choose “Configure landline number”, click “Next”
    2. Choose “multiple landline numbers (ISDN line)”, click “Next”
    3. Add the MSN numbers you will use in your Fritz!Box each in a separate entry, then click “Next”
    4. Click “Next” to save the settings.
  7. Configure any devices you need to connect to the MSN numbers you entered.

Setting up the diversion of Anonymous calls to an Answering Machine:

  1. Finally I set-up an answering machine for anonymous call forwarding:
    Automatically diverting anonymous calls to the internal answering machine | FRITZ!Box 7490 | AVM International.

    • Note that here you can divert all anonymous calls to “all numbers”, but not divert all anonymous calls to “Landline Network”. I think this is a bug in FRITZ!OS 6.20.
  2. And (since the Fritz!Box already has some VOIP numbers configured), I also added the GigaSet as an ISDN PBX to the Fritz!Box:
    1. In the menu on the left, click on “Telephony”, then on “Telephone Devices”.
    2. Choose “Configure New Device”, then follow the Wizard Steps:
      1. Choose “ISDN PBX”, click “Next”
      2. Note the MSNs the Fritz!Box shows (they should include both the ISDN MSNs and VOIP numbers), then click “Next”.
      3. Verify the ISDN PBX (the GigaSet) is on the FON S0 port, then click Apply to confirm.
    3. In the menu on the left, click on “Telephony”, then on “Telephone Devices”.
    4. Choose “Edit” for the “ISDN PBX” connected to “FON S0”.
    5. Verify the “Main Phone Number” is correct (choose either an ISDN MSN or VOIP number).
    6. Then I configured the extra VOIP numbers as MSNs in the GigaSet.

–jeroen

** Larger images.

Read the rest of this entry »

Posted in DECT, Gigaset, ISDN, Power User, PSTN, Telephony | Leave a Comment »

 
%d bloggers like this: