Difference between pages "Sucknews" and "Configuration files"

From Wikislax
(Difference between pages)
Jump to: navigation, search
(Created page with "{{RightTOC}} == What is Sucknews ? == Sucknews affords getting the newsfeeds over a regular NNTP connection with your Internet Service Provider. This comes in handy when you...")
 
(Network configuration)
 
Line 1: Line 1:
{{RightTOC}}
+
The location of the configuration files depend on the specific distribution, but is usually subdirectories of, or files in <tt>'''/etc'''</tt>, <tt>'''/usr/etc'''</tt>, <tt>'''/usr/local/etc'''</tt>. The files are set up by installation but can be updated later. Applying the configuration change will then be a matter of restarting the corresponding daemon. The main Slackware configuration files are :
 +
<br/>
  
== What is Sucknews ? ==
+
== Init configuration ==
  
Sucknews affords getting the newsfeeds over a regular NNTP connection with your Internet Service Provider. This comes in handy when you are not a big company and have no agreements with peer Newsgroup servers.
+
{| {{thead}}
 +
|-
 +
! {{chead}} width="200" | File
 +
! {{chead}} | Content
 +
|-
 +
| <tt>'''/etc/inittab'''</tt>||contains the default runlevel (3=multi-user, 4=graphical). On a live system, <tt>'''telinit n'''</tt> affords changing the level interactively.
 +
|-
 +
| <tt>'''/etc/fstab'''</tt>||contains descriptions on the filesystems used on this computer, including the device, the mount point, the filesystem type and the opening options. Use <tt>'''man fstab'''</tt>, copy, and try !
 +
|-
 +
| <tt>'''/etc/http'''</tt>||Directory containing the Apache configuration files such as httpd.conf.
 +
|-
 +
| <tt>'''/etc/lilo.conf'''</tt>||used by lilo to generate a boot sector on the device or on the MBR (master boot record). If on the device and using the Windows bootloader, don't forget to copy the boot sector on a disquette so as to be able to use it from Windows.
 +
|-
 +
| <tt>'''/etc/mail'''</tt>||Directory containing the Sendmail configuration files such as sendmail.mc and sendmail.cf. Spamassassin configuration also goes here as a subdirectory.
 +
|-
 +
| <tt>'''/etc/mail/aliases'''</tt>||File containing a list of users that do not exist on the server and whose mail is redirected to existing users. After modifying this file the command <tt>'''newaliases'''</tt> must be ran.
 +
# redirect news
 +
usenet:        news
 +
|-
 +
| <tt>'''/etc/ntp.conf'''</tt>||Configuration for the network time protocol. Add ntp servers for your region as below. After an update, restart using <tt>'''/etc/rc.d/rc.ntpd restart'''</tt>.
 +
# NTP server (list one or more) to synchronize with:
 +
server 0.fr.pool.ntp.org
 +
server 1.fr.pool.ntp.org
 +
server 2.fr.pool.ntp.org
 +
server 3.fr.pool.ntp.org
 +
|-
 +
| <tt>'''/etc/profile'''</tt>||don't forget to update the paths:
 +
MANPATH=/usr/local/share/man:/usr/local/man:/usr/man
 +
|-
 +
| <tt>'''/etc/profile.d'''</tt>||the files contained in this directory are executed at login when executable. To remove the "Game of fortune" on user login :
 +
chmod a-x /etc/profile.d/bsd-games-login-fortune.*
 +
|-
 +
| <tt>'''/etc/ld.so.conf'''</tt>||list of additional libraries. Needs <tt>'''/sbin/ldconfig'''</tt> after adding new libraries. Add <tt>'''/usr/local/lib64'''</tt> here.
 +
|-
 +
| <tt>'''.bashrc'''</tt>||Specify <tt>'''. /etc/profile'''</tt> on a line of itself to use in <tt>'''konsole'''</tt> the same environment as in the command line. This will afford <tt>'''colorls'''</tt> to work in new <tt>'''konsole'''</tt> tabs.
 +
|}
 +
<br clear=all>
  
== Installing Sucknews ==
+
== The /etc/rc.d directory ==
  
There was a time when sucknews was available from [http://www.sucknews.org sucknews.org] but this site has disappeared and there seems to be no obvious source of sucknews update software so we'll stick with an old [{{SERVER}}/slax/download/suck-4.3.2.tar.gz version] (perfectly satisfactory anyway). Untar and install as below :
+
The <tt>'''/etc/rc.d'''</tt> directory contains the scripts used to initialize the system services at the end of the bootTo use a specific script at startup, make it user-executable. To stop using it, remove the execution rights. Depending on the situation, scripts are called with the <tt>'''start'''</tt>, <tt>'''stop'''</tt>, or <tt>'''restart'''</tt> parameter.
 
+
<br/>
# tar -C /usr/local -xvf suck-x.y.z.tar.gz
 
# cd /usr/local
 
# chown -R root:root suck-x.y.z.tar.gz
 
# cd suck-x.y.z.tar.gz
 
# ./configure --help | less
 
# ./configure --prefix=/usr/local/news --libdir=/usr/local/news/lib64 --mandir=/usr/local/man \
 
--with-inn-lib=/usr/local/news/lib --with-inn-include=/usr/local/news/include --with-perl-exe=/usr/bin
 
# make
 
# make install
 
# make clean
 
# cd /usr/local/news/bin
 
# chown <nowiki>news:news</nowiki> lmove rpost suck testhost
 
 
 
== Running Sucknews ==
 
 
 
The below script affords posting the local messages and get entering messages on your Internet Service Provider site :
 
 
 
# su news
 
$ cd /usr/local/news/bin
 
$ '''vi suck.sh'''
 
'''i'''
 
#!/bin/sh
 
 
NNTP_SERVER=news.free.fr
 
NEWS_PATH=/usr/local/news
 
BIN_PATH=/usr/local/news/bin
 
SUCK_PATH=/usr/local/news/bin
 
BATCH_PATH=/usr/local/news/spool/outgoing/free
 
FILTER_PATH=$SUCK_PATH/filter.sh
 
 
cd $SUCK_PATH
 
 
######################################################
 
# posting outgoing articles (localhost->NNTP_SERVER) #
 
######################################################
 
 
echo "Sending articles..."
 
if test -s $BATCH_PATH
 
then
 
$BIN_PATH/rpost $NNTP_SERVER -b $BATCH_PATH \
 
    -f $FILTER_PATH \$\$o=/tmp/filtered \$\$i /tmp/filtered
 
else
 
    echo "No articles to post..."
 
fi
 
 
######################################################
 
# getting incoming articles (NNTP_SERVER->localhost) #
 
######################################################
 
 
echo Getting articles...
 
if [ -e /tmp/newposts ]; then
 
    rm /tmp/newposts
 
fi
 
$BIN_PATH/suck $NNTP_SERVER -AL $NEWS_PATH/db/active -i 0 -n -H -K -br /tmp/newposts -c
 
if [ -e /tmp/newposts ]; then
 
    $BIN_PATH/rnews /tmp/newposts
 
fi
 
cat /dev/null > $BATCH_PATH
 
'''<esc>'''
 
''':x'''
 
$ chmod u+x suck.sh
 
$ ./suck.sh
 
Sending articles...
 
No articles to post...
 
  Getting articles...
 
Attempting to connect to news.free.fr
 
Using Port 119
 
Official host name: news.free.fr
 
Address: 212.27.60.38
 
Address: 212.27.60.39
 
Address: 212.27.60.37
 
Address: 212.27.60.40
 
Connected to news.free.fr
 
200 news-4.free.fr (4-2) NNRP Service Ready - newsmaster@proxad.net (posting ok)
 
No sucknewsrc to read, creating
 
Adding new groups from local active file to sucknewsrc
 
New Group - adding to sucknewsrc: control
 
control - 1 articles 3983-3983
 
New Group - adding to sucknewsrc: control.cancel
 
control.cancel - 349 articles 94271852-94272200
 
New Group - adding to sucknewsrc: control.checkgroups
 
control.checkgroups - 4 articles 5228-5231
 
New Group - adding to sucknewsrc: control.newgroup
 
control.newgroup - 1 articles 73186-73186
 
New Group - adding to sucknewsrc: control.rmgroup
 
control.rmgroup - 1 articles 30996-30996
 
New Group - adding to sucknewsrc: junk
 
junk - 1 articles 38322-38322
 
New Group - adding to sucknewsrc: alt.os.linux.slackware
 
alt.os.linux.slackware - 1907 articles 231211-233117
 
Elapsed Time = 0 mins 0.72 seconds
 
2227 Articles to download
 
Deduping Elapsed Time = 0 mins 0.00 seconds
 
Deduped, 2227 items remaining, 0 dupes removed.
 
Total articles to download: 2227
 
5290946 Bytes received in 1 mins 20.79 secs, BPS = 65489.2
 
Closed connection to news.free.fr
 
Building RNews Batch File(s)
 
Cleaning up after myself
 
news@inner:/usr/local/news/bin$
 
<ctrl>d
 
#
 
 
 
In the first part, messages are posted to the provider using '''rpost'''. The list of articles is obtained from the information contained in newsfeed file '''/usr/local/news/spool/outgoing/free'''. The '''-f''' option affords applying a filter to the messages so as to expurge certain headers :
 
 
 
#!/bin/sh
 
/usr/local/news/bin/sm -R $1 | sed -e "/^X-Trace/d" -e "/^NNTP-Posting-Host/d" \
 
-e "/^Xref/d" -e "/^X-Complaints-To/d" -e "/^NNTP-Posting-Date/d" > $2
 
  
In the second part, suck gets the messages from your Internet Service Provider. The '''-AL''' option affords using the list of groups defined. '''-i 0''' indicates that there is no limit on the number of messages to get, '''-n''' is for the mode « messages identified by their numbers by the provider » '''-c''' is to update the numbers after the end of the operation, '''-br''' defines the output file, '''-H''' and '''-K''' afford skipping the historic and killfile options. The file written is afterwards used by '''rnews'''. The articles are then available.
+
== Network configuration ==
  
== Automating Sucknews ==
+
The network configuration is done during system installation but it is possible to change it later by editing the files and restarting the right daemon:
  
Automate Sucknews execution using '''crontab'''. In the example below, suck.sh is executed at 13:00 daily :
+
{| {{thead}}
 +
|-
 +
! {{chead}} width="200" | File
 +
! {{chead}} | Content
 +
|-
 +
| <tt>'''/etc/rc.d/rc.inet1.conf'''</tt>||configuration of the network. For Xen the standard configuration uses a bridge. A bridge gathers several physical network interfaces. The bridge is configured with an IP address while the physical network interfaces are left unconfigured. After an update, restart using <tt>'''/etc/rc.d/rc.inet1 restart'''</tt>.
 +
# Config information for eth0:
 +
IPADDR[0]=""
 +
NETMASK[0]=""
 +
USE_DHCP[0]=""
 +
DHCP_HOSTNAME[0]=""
 +
. . .
 +
# Example of how to configure a bridge:
 +
# Note the added "BRNICS" variable which contains a space-separated list
 +
# of the physical network interfaces you want to add to the bridge.
 +
IFNAME[0]="br0"
 +
BRNICS[0]="eth0"
 +
IPADDR[0]="192.168.0.1"
 +
NETMASK[0]="255.255.255.0"
 +
USE_DHCP[0]=""
 +
DHCP_HOSTNAME[0]=""
 +
|-
 +
| <tt>'''/etc/rc.d/rc.networkmanager'''</tt>||is a script to allow network automatic configuration. If you manually set '''rc.inet1.conf''', make sure this scrit does not have execution rights.
 +
|-
 +
| <tt>'''/etc/rc.d/rc.ipforward'''</tt>||is a script to allow forwarding of packets between the interfaces. This is useful for a computer with several interfaces, for instance a firewall. To allow forwarding, just make the script executable.
 +
|-
 +
| <tt>'''/etc/ssh/sshd_config'''</tt>||ssh server configuration. '''PermitRootLogin yes''' affords login as root. To authorize X11Forwarding use '''X11Forwarding yes'''. After an update, restart using '''/etc/rc.d/rc.sshd restart'''.
 +
|-
 +
| <tt>'''/etc/ssh/ssh_config'''</tt>||ssh client configuration. To authorize X11Forwarding use '''ForwardX11 yes''' and '''ForwardX11Trusted yes''' to avoid a warning using '''ssh''' and get better security.
 +
|-
 +
| <tt>'''/etc/hosts'''</tt>||contains the addresses of the local hosts that bind cannot resolve, as they are in a private addressing plan. It is also possible to specify here addresses that will be chosen in lieu of their official address.
 +
|-
 +
| <tt>'''/etc/rc.d/rc.bind'''</tt>||setting this script as user-executable will afford running the local computer to be its own DNS.
 +
|-
 +
| <tt>'''/etc/named.conf'''</tt>||uncomment the query-source directive to suppress the port-unreachable packets on '''lo'''.
 +
|-
 +
| <tt>'''/etc/resolv.conf'''</tt>||if using local bind, which is recommended, append a line with <tt>'''nameserver 127.0.0.1'''</tt>.
 +
|-
 +
| <tt>'''/etc/udev/rules.d/70-persistent-net.rules'''</tt>||affords changing which interface is eth0.
 +
|}
 +
<br clear=all>
  
# su news
+
<u>Note</u> : In case of network issue, it can be a good idea to check the configuration using <tt>'''ifconfig -a'''</tt>, <tt>'''netstat -f inet -rn'''</tt>, and <tt>'''route'''</tt>. The routes are kept from one boot to the other and it may become necessary to delete the existing routes using <tt>'''route flush'''</tt>, then reboot.
$ crontab -e
 
# MIN HOUR DAY MONTH DAYOFWEEK COMMAND
 
00 13 * * * /usr/local/news/bin/suck.sh
 
30 13 * * * /usr/local/news/bin/news.daily expireover lowmark
 
  
 
<br/>
 
<br/>
  
{{pFoot|[[INN]]|[[Main Page]]|[[Asterisk]]}}
+
{{pFoot|[[Linux basics]]|[[Main Page]]|[[IPTables]]}}

Revision as of 23:04, 16 December 2022

The location of the configuration files depend on the specific distribution, but is usually subdirectories of, or files in /etc, /usr/etc, /usr/local/etc. The files are set up by installation but can be updated later. Applying the configuration change will then be a matter of restarting the corresponding daemon. The main Slackware configuration files are :

Init configuration

File Content
/etc/inittab contains the default runlevel (3=multi-user, 4=graphical). On a live system, telinit n affords changing the level interactively.
/etc/fstab contains descriptions on the filesystems used on this computer, including the device, the mount point, the filesystem type and the opening options. Use man fstab, copy, and try !
/etc/http Directory containing the Apache configuration files such as httpd.conf.
/etc/lilo.conf used by lilo to generate a boot sector on the device or on the MBR (master boot record). If on the device and using the Windows bootloader, don't forget to copy the boot sector on a disquette so as to be able to use it from Windows.
/etc/mail Directory containing the Sendmail configuration files such as sendmail.mc and sendmail.cf. Spamassassin configuration also goes here as a subdirectory.
/etc/mail/aliases File containing a list of users that do not exist on the server and whose mail is redirected to existing users. After modifying this file the command newaliases must be ran.
# redirect news
usenet:         news
/etc/ntp.conf Configuration for the network time protocol. Add ntp servers for your region as below. After an update, restart using /etc/rc.d/rc.ntpd restart.
# NTP server (list one or more) to synchronize with:
server 0.fr.pool.ntp.org
server 1.fr.pool.ntp.org
server 2.fr.pool.ntp.org
server 3.fr.pool.ntp.org
/etc/profile don't forget to update the paths:
MANPATH=/usr/local/share/man:/usr/local/man:/usr/man
/etc/profile.d the files contained in this directory are executed at login when executable. To remove the "Game of fortune" on user login :
chmod a-x /etc/profile.d/bsd-games-login-fortune.*
/etc/ld.so.conf list of additional libraries. Needs /sbin/ldconfig after adding new libraries. Add /usr/local/lib64 here.
.bashrc Specify . /etc/profile on a line of itself to use in konsole the same environment as in the command line. This will afford colorls to work in new konsole tabs.


The /etc/rc.d directory

The /etc/rc.d directory contains the scripts used to initialize the system services at the end of the boot. To use a specific script at startup, make it user-executable. To stop using it, remove the execution rights. Depending on the situation, scripts are called with the start, stop, or restart parameter.

Network configuration

The network configuration is done during system installation but it is possible to change it later by editing the files and restarting the right daemon:

File Content
/etc/rc.d/rc.inet1.conf configuration of the network. For Xen the standard configuration uses a bridge. A bridge gathers several physical network interfaces. The bridge is configured with an IP address while the physical network interfaces are left unconfigured. After an update, restart using /etc/rc.d/rc.inet1 restart.
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
. . .
# Example of how to configure a bridge:
# Note the added "BRNICS" variable which contains a space-separated list
# of the physical network interfaces you want to add to the bridge.
IFNAME[0]="br0"
BRNICS[0]="eth0"
IPADDR[0]="192.168.0.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
/etc/rc.d/rc.networkmanager is a script to allow network automatic configuration. If you manually set rc.inet1.conf, make sure this scrit does not have execution rights.
/etc/rc.d/rc.ipforward is a script to allow forwarding of packets between the interfaces. This is useful for a computer with several interfaces, for instance a firewall. To allow forwarding, just make the script executable.
/etc/ssh/sshd_config ssh server configuration. PermitRootLogin yes affords login as root. To authorize X11Forwarding use X11Forwarding yes. After an update, restart using /etc/rc.d/rc.sshd restart.
/etc/ssh/ssh_config ssh client configuration. To authorize X11Forwarding use ForwardX11 yes and ForwardX11Trusted yes to avoid a warning using ssh and get better security.
/etc/hosts contains the addresses of the local hosts that bind cannot resolve, as they are in a private addressing plan. It is also possible to specify here addresses that will be chosen in lieu of their official address.
/etc/rc.d/rc.bind setting this script as user-executable will afford running the local computer to be its own DNS.
/etc/named.conf uncomment the query-source directive to suppress the port-unreachable packets on lo.
/etc/resolv.conf if using local bind, which is recommended, append a line with nameserver 127.0.0.1.
/etc/udev/rules.d/70-persistent-net.rules affords changing which interface is eth0.


Note : In case of network issue, it can be a good idea to check the configuration using ifconfig -a, netstat -f inet -rn, and route. The routes are kept from one boot to the other and it may become necessary to delete the existing routes using route flush, then reboot.


Linux basics Main Page IPTables