Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 6382

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The Linux UUCP HOWTO: Setting up the config files</TITLE>
 <LINK HREF="UUCP-HOWTO-5.html" REL=next>
 <LINK HREF="UUCP-HOWTO-3.html" REL=previous>
 <LINK HREF="UUCP-HOWTO.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="UUCP-HOWTO-5.html">Next</A>
<A HREF="UUCP-HOWTO-3.html">Previous</A>
<A HREF="UUCP-HOWTO.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4. Setting up the config files</A></H2>

<P>
<!--
UUCP!config files
-->
<P>I recommend you start by installing the attached known-good config. files
included in the document.
<P>
<H2><A NAME="ss4.1">4.1 Installing config. files </A>
</H2>

<P>
<!--
UUCP!config files!installing
-->
<P>
<P>Put these file in their "standard" location: <CODE>/etc/uucp</CODE> on recent
linux distributions or <CODE>/usr/lib/uucp</CODE> on older ones.
<P>Then make sure that the <CODE>permissions</CODE> of the files are
<P>
<BLOCKQUOTE><CODE>
<PRE>
(guylhem@barberouge:uucp)$ ls -l
total 11
-rw-r--r--   1 uucp     uucp          501 Jan 23 11:33 Poll
-rw-r-----   1 uucp     uucp          589 Jan 23 11:34 call
-rw-r-----   1 uucp     uucp         1184 Jan 23 12:06 config
-rw-r-----   1 uucp     uucp          476 Jan 23 12:31 crontab
-rw-r-----   1 uucp     uucp         1256 Jan 23 11:47 dial
-rw-r-----   1 uucp     uucp          486 Jan 23 11:48 passwd
-rw-r-----   1 uucp     uucp          810 Jan 23 11:55 port
-rw-r--r--   1 uucp     uucp         1690 Jan 23 12:04 sys
(guylhem@barberouge:uucp)$
</PRE>
</CODE></BLOCKQUOTE>
<P>To change file owner, as root, type:
<BLOCKQUOTE><CODE>
<PRE>
(root@barberouge:uucp)$ chown uucp.uucp *
</PRE>
</CODE></BLOCKQUOTE>
<P>Then you must change file permissions; as root once again, type:
<BLOCKQUOTE><CODE>
<PRE>
(root@barberouge:uucp)# chmod 640 *
(root@barberouge:uucp)# chmod +r Poll sys
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss4.2">4.2 "Poll" file </A>
</H2>

<P>
<!--
UUCP!config files!poll file
-->
<P>This file is used to set polling timetables for any system.
<P>
<BLOCKQUOTE><CODE>
<PRE>
schedule polux 01
poll     polux 01
</PRE>
</CODE></BLOCKQUOTE>
<P>My machine calls polux at 01:00, that's all!
<P>You can add more line if you must call many other machines, but don't forget to
put the 2 lines (schedule &amp; poll) for each.
<P>
<H2><A NAME="ss4.3">4.3 "call" file </A>
</H2>

<P>
<!--
UUCP!config files!call file
-->
<P>It contains your login/password for each system you poll:
<BLOCKQUOTE><CODE>
<PRE>
polux uudan password
</PRE>
</CODE></BLOCKQUOTE>
<P>My machine uses "uudan" login &amp; "password" password :-) when it polls "polux".
<P>As for Poll, adapt this to your situation.
<P>
<H2><A NAME="ss4.4">4.4 "config" file </A>
</H2>

<P>
<!--
UUCP!config files!config file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
nodename barberouge                     # The UUCP name of this system

spool /var/spool/uucp                   # The UUCP spool directory
pubdir /var/spool/uucppublic            # The UUCP public directory
logfile /var/log/uucp/log               # The UUCP log file
statfile /var/log/uucp/stats            # The UUCP statistics file
debugfile /var/log/uucp/debug           # The UUCP debugging file

#sysfile        /etc/uucp/sys           # Default "sys"
#portfile       /etc/uucp/port          # Default "port"
#dialfile       /etc/uucp/dial          # Default "dial"
#dialcodefile   /etc/uucp/dialcode      # Default "dialcode"
#callfile       /etc/uucp/call          # Default "call"
#passwdfile     /etc/uucp/passwd        # Default "passwd"

# No commands may be executed by unknowns (empty list of permitted commands)
# Upload is authorized in /var/spool/uucp
unknown commands
unknown pubdir /var/spool/uucp
unknown remote-send ~ !~/upload
unknown remote-receive ~/upload
</PRE>
</CODE></BLOCKQUOTE>
<P>Here just replace "barberouge" by your system name ; run "hostname" if you
can't remind it.
<P>
<H2><A NAME="ss4.5">4.5 "crontab" file </A>
</H2>

<P>
<!--
UUCP!config files!crontab file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
# Every day just before morning generate reports.
#
0 7 * * *     /usr/lib/uucp/uudemon.day root
#
# Every hour start the uudemon.hr. To actually poll a remote system,
# enter its name in /etc/uucp/Poll. You are encouraged to change the "8".
#
8 * * * *      /usr/lib/uucp/uudemon.hr
</PRE>
</CODE></BLOCKQUOTE>
<P>Just run "crontab -u uucp /etc/uucp/crontab" to add it to the others crontabs.
<P>
<H2><A NAME="ss4.6">4.6 "dial" file </A>
</H2>

<P>
<!--
UUCP!config files!dial file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
# 1) expect nothing (i.e., continue with step 2)
# 2) send "ATZ", then a carriage return, then sleep for 1 to 2 seconds.
# The \c means to not send a final carriage return.
# 3) wait until the modem echoes "OK", then do the the same for "ATX4" &amp; "OK"
# 4) send "ATDT", then the telephone number (after translating any dialcodes).
# 5) wait until the modem echoes "CONNECT"
# 6) if we get "BUSY", "NO CARRIER" ... during the chat script we abort dialing
# 7) when the call is over, we make sure we hangup the modem


dialer hayes
chat "" ATZ\r\d\c OK\r \dATX4\r\d\c OK\r ATDT\D CONNECT
chat-fail RING
chat-fail NO\sCARRIER
chat-fail ERROR
chat-fail NO\sDIALTONE
chat-fail BUSY
chat-fail NO\sANSWER
chat-fail VOICE
complete \d\d+++\d\dATH\r\c
abort \d\d+++\d\dATH\r\c

# You can also add other dialers: inetd, nullmodem ...
#dialer nullmodem
#complete \d\dexit\r\c
#abort \d\dexit\r\c
</PRE>
</CODE></BLOCKQUOTE>
<P>Syntax is complicated ... you'd rather not touch anything here but "ATZ" &amp;
"ATX4" which are my modem init string.
<P>
<H2><A NAME="ss4.7">4.7 "passwd" file </A>
</H2>

<P>
<!--
UUCP!config files!passwd file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
#uuguest                guestpassword
</PRE>
</CODE></BLOCKQUOTE>
<P>If you allow uucp dialin, just add system/passwords in this file.
<P>It's *that* simple.
<P>But it's recommended for security reasons to make sure each have a separate
account &amp; home directory so you can track things.
<P>
<H2><A NAME="ss4.8">4.8 "port" file </A>
</H2>

<P>
<!--
UUCP!config files!port file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
# Description for the modem entry
# Debianers, make SURE this device is root:dialout, mode 0660 (crw-rw---)

port ACU
type modem
device /dev/ttyS0
dialer hayes
speed 57600
# hardflow n


# Description for the TCP port - pretty trivial. DON'T DELETE.
# Change service number if non standard, cf /etc/services

port TCP
type tcp
#service 540


# Description for the nullmodem entry
# (ttyS1 means COM2)

port nullmodem
type direct
device /dev/ttyS1
dialer nullmodem
speed 115200
</PRE>
</CODE></BLOCKQUOTE>
<P>You shouldn't change anything here ... except your modem port.
<P>On recent distributions with mgetty, it's <CODE>/dev/ttySN</CODE> while on older
distributions it's <CODE>/dev/cuaN</CODE>, where N is you serial port:
<P>N starts at 0 &amp; ttyS(N) means COM(N+1), for example, my null-modem is on ttyS1
(COM2) while my modem is on ttyS0 (COM1).
<P>Most of recent modems support hardware flow control, if your doesn't, just
uncomment the line "# hardflow n".
<P>
<H2><A NAME="ss4.9">4.9 "sys" file </A>
</H2>

<P>
<!--
UUCP!config files!sys file
-->
<P>
<BLOCKQUOTE><CODE>
<PRE>
# First some defaults. These are for ALL other entries (unless overridden).
#
protocol gvG
protocol-parameter G packet-size 1024
# protocol-parameter G window 7
protocol-parameter G short-packets

#
# Our remote uucp connection.
#
system polux
call-login *
call-password *
local-send /
local-receive /var/spool/uucppublic
remote-send /
remote-receive /var/spool/uucppublic
time any
phone 0111111110
port ACU
chat "" \r\c ogin:-BREAK-ogin:-BREAK- \L word: \P
#chat "" \d\d\r\c ogin: \d\L word: \P

# This is an alternate - it means that if a connection using the above
# "system polux" fails it falls through to this entry.
# Only useful if your service provider has more then one phone number for UUCP.
#
#alternate polux-2
#alias polux-2
#phone 0222222220

# Here's another alternate - we poll the system over TCP/IP.
# This is useful if we have a PPP connection to our provider.
# The first two entries will fail because the modem is busy &amp; we will poll
# over TCP/IP.
#
#alternate polux-tcp
#alias polux-tcp
#time any
#address uucp.polux
#port TCP
#protocol t

#
# Last example - a system that we poll over TCP/IP.
#
#system horizon
#call-login *
#call-password *
#time any
#chat "" \d\d\r\c ogin: \d\L word: \P
#address uucp.horizon.nl
#port TCP
#protocol t
</PRE>
</CODE></BLOCKQUOTE>
<P>Here, you must change "polux" by the name of the system you poll &amp; "0111111110"
by its phone number.
<P>"polux-2", "polux-tcp" &amp; "horizon" are just examples of user specific needs ;
if the system you poll has more than one line, define it as "itsname-2" ; if
you call it by PPP sometimes, just define "itsname-tcp" also.
<P>It's useful when chat script fail (busy ...)
<P>
<H2><A NAME="ss4.10">4.10 Now let's test all this </A>
</H2>

<P>
<!--
UUCP!testing
-->
<P>First run:
<P>
<BLOCKQUOTE><CODE>
<PRE>
(root@barberouge:uucp)# su uucp
(uucp@barberouge:uucp)# /usr/lib/uucp/uuchk
Local node name barberouge
Spool directory /var/spool/uucp
Public directory /var/spool/uucppublic
Lock directory /var/lock
Log file /var/log/uucp/log
Statistics file /var/log/uucp/stats
Debug file /var/log/uucp/debug
Global debugging level
uucico -l will strip login names and passwords
uucico will strip UUCP protocol commands
Start uuxqt once per uucico invocation

System: polux
 When called using any login name
 Call out using port ACU
 The possible ports are:
  Port name ACU
   Port type modem
   Device /dev/ttyS0
   Speed 57600
   Carrier available
   Hardware flow control available
   Dialer hayes
    Chat script "" ATZ\r\d\c OK\r \dATX4\r\d\c OK\r ATDT\D CONNECT
    Chat script timeout 60
    Chat failure strings RING NO\sCARRIER ERROR NO\sDIALTONE BUSY NO\sANSWER VOICE
    Chat script incoming bytes stripped to seven bits
    Wait for dialtone ,
    Pause while dialing ,
    Carrier available
    Wait 60 seconds for carrier
    When complete chat script "" \d\d+++\d\dATH\r\c
    When complete chat script timeout 60
    When complete chat script incoming bytes stripped to seven bits
    When aborting chat script "" \d\d+++\d\dATH\r\c
    When aborting chat script timeout 60
    When aborting chat script incoming bytes stripped to seven bits
 Phone number 0111111110
 Chat script "" \r\c ogin:-BREAK-ogin:-BREAK- \L word: \P
 Chat script timeout 10
 Chat script incoming bytes stripped to seven bits
 Login name uudan
 Password your_password_here
 At any time may call if any work
 May retry the call up to 26 times
 May make local requests when calling
 May make local requests when called
 May send by local request: /
 May send by remote request: /
 May accept by local request: /var/spool/uucppublic
 May receive by remote request: /var/spool/uucppublic
 May execute /usr/bin/uucp /usr/bin/rmail /usr/bin/rnews
 Execution path /bin /usr/bin /usr/local/bin /usr/sbin
 Will leave 50000 bytes available
 Public directory is /var/spool/uucppublic
 Will use protocols gvG
 For protocol G will use the following parameters
  packet-size 1024
  short-packets
</PRE>
</CODE></BLOCKQUOTE>
<P>to check if all the informations you've set are correct.
<P>Warning: your mileage may vary ; different distributions use different
paths, regardless Linux FSSTD!
<P>If everything is correct, run:
<P>
<BLOCKQUOTE><CODE>
<PRE>
        /usr/sbin/uucico -r 1 -x 9 -s remote_system_name
</PRE>
</CODE></BLOCKQUOTE>
<P>The <CODE>-x 9</CODE> will have maximum debugging information written to the
<CODE>/var/log/uucp/debug</CODE> file for help in initial setup. 
<P>I normally run <CODE>-x 4</CODE> here since that level logs details that help me
with login problems.
Obviously, this text contains clear informations from your systems file
(account/password) so protect it against world-read.
<P>
<H2><A NAME="ss4.11">4.11 Additional informations </A>
</H2>

<P>
<!--
UUCP!information resources
-->
<P>>From <EM>Pierre.Beyssac at emeraude.syseca.fr</EM>
<P>Taylor has more logging levels.  Use -x all to get the highest level possible.
<P>Also, do a <CODE>"tail -f /var/log/uucp/debug"</CODE> while debugging to watch
things happen on the fly.
<P>
<HR>
<A HREF="UUCP-HOWTO-5.html">Next</A>
<A HREF="UUCP-HOWTO-3.html">Previous</A>
<A HREF="UUCP-HOWTO.html#toc4">Contents</A>
</BODY>
</HTML>