Ticket #111 (assigned defect)

Opened 6 years ago

Last modified 6 years ago

/usr/local/bin/zone_update script

Reported by: lewis Owned by: Ernest0x
Priority: normal Milestone:
Severity: normal Keywords:
Cc:

Description

όταν πάω να το τρέξω μου λέει:

nefeli:~# /usr/local/bin/zone_update twmn >>/var/log/zone_update.log /usr/local/bin/zone_update: line 67: [: -le: unary operator expected

τι να κάμω καλιέ κύριοι ?

Attachments

zone_update_patched Download (4.1 KB) - added by Ernest0x 6 years ago.
awmn Download (43.3 KB) - added by Ernest0x 6 years ago.
.awmn zone file for reference
vwmn Download (345 bytes) - added by schatzin 6 years ago.

Change History

Changed 6 years ago by Ernest0x

comment:1 Changed 6 years ago by Ernest0x

  • Owner set to Ernest0x

Please use the attached script instead and post the output. If I have guessed correctly you should now get a different, human-friendly error.

comment:2 Changed 6 years ago by lewis

γιά δές... : nefeli:/usr/src/wind/tools# ./zone_update_patched twmn ./zone_update_patched: line 2: !DOCTYPE: No such file or directory ./zone_update_patched: line 3: PUBLIC: command not found ./zone_update_patched: line 4: syntax error near unexpected token `newline' ./zone_update_patched: line 4: ` " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' nefeli:/usr/src/wind/tools# ./zone_update_patched 10.in-addr.arpa ./zone_update_patched: line 2: !DOCTYPE: No such file or directory ./zone_update_patched: line 3: PUBLIC: command not found ./zone_update_patched: line 4: syntax error near unexpected token `newline' ./zone_update_patched: line 4: ` " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'

comment:3 Changed 6 years ago by lewis

άκυρο το προηγούμενο πήγα να κατεβάσω το script με το wget και τάκανε μπάχαλο....

δες λίγο το output: nefeli:/usr/src/wind/tools# ./zone_update_patched twmn /etc/bind/twmn-zone/twmn has errors (wrong syntax or missing '; serial' comment). nefeli:/usr/src/wind/tools# ./zone_update_patched 10.in-addr.arpa /etc/bind/twmn-zone/10.in-addr.arpa has errors (wrong syntax or missing '; serial' comment).

τα 2 αρχεία δεν υπήρχαν, και τα έβαλα με το χέρι... το ένα είναι αυτό:

$ORIGIN . $TTL 5 ; 5 seconds twmn IN SOA ns0.twmn. hostmaster.twmn.net. (

0000001 ; serial 43200 ; refresh (12 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 5 ; minimum (5 seconds) )

$TTL 3600 ; 1 hour

Changed 6 years ago by Ernest0x

  • attachment awmn Download added

.awmn zone file for reference

comment:4 Changed 6 years ago by Ernest0x

This error message indicates an error in your zone file. Since copy/pasting the contents of your zone file doesn' t seem to work here (due to html rendering issues I guess), please, place the whole zone file here as attachment to download and check it. I also attached the zone file for awmn zone we use in AWMN to give you an idea of how your own zone files should be like. Pay attention to the line containing the serial and make sure you append a "; serial" comment after the serial.

PS. I' m commenting in english in case this ticket is read by non-greek speakers. I hope this does not confuse you in any way. :)

comment:5 Changed 6 years ago by Ernest0x

  • Status changed from new to assigned

comment:6 Changed 6 years ago by schatzin

I think that in order to make it simpler you should clearly state that the zone files should be in the bind_dir/zones/ and that they should be named after the zone and not db.zone, because in that case the named-checkzone does not work!

Other than that I managed to get to line 73: if [ $VCS -le 9 ]; then which outputs: /usr/local/bin/zone_update_patched: line 73: [: -le: unary operator expected

Any ideas...???

comment:7 Changed 6 years ago by schatzin

You can find attached the zone file.

Changed 6 years ago by schatzin

  • attachment vwmn Download added

comment:8 Changed 6 years ago by Ernest0x

Where the zone files are expected to be found is configured in the variable ZONES_ROOT at the top of the script. By default, ZONES_ROOT is set equal to "/etc/bind/zones" which is the default location for zone files in Debian distro, but you can change it to whatever directory you place your zone files in. This is described in step 3 of the documentation. As for the naming of the zone files you are right. It will be included in the documentation that the zones files should be named after the zone they describe. The error you get in line 73 is because your serial line is not the expected one. I see in your zone file that your serial line is "10 ; serial". An expected serial line would be something like "2006060310 ; serial". In other words, the correct format format is "yyyymmdd## ; serial". Of course, the script should be clever enough to produce a better error than what you got, so expect a patched of the patched version :P soon committed in svn.

Thank you.

Note: See TracTickets for help on using tickets.