Wed Jul 19 08:04:24 2017 UTC

NuTyX version 9.0 manual

CONFIGURATION

This manual page tells you how to configure your NuTyX GNU/Linux operating system. Please refer to the files described here to obtain more information.
The configuration of NuTyX includes:
  • the keyboard,
  • the network,
  • defining partitions or extra disks for mounting,
  • adding a swap partition or swap file,
  • creating new users,
  • adjusting the clock,
  • giving your machine a name,
  • setting locale and language,
  • the booting process,
  • the manual loading of the kernel modules,
  • adjusting the file taking care of the boot process.

  1. The keyboard

  2. The file /etc/sysconfig/console defines the configuration of the keyboard when you are not in graphical mode. Here is an example of a console configuration:
    cat >  /etc/sysconfig/console << "EOF"
    FONT="LatGrkCyr-8x16"
    UNICODE="1"
    LOGLEVEL=1
    KEYMAP=fr_CH-latin1.map
    "EOF"
    The FONT variable defines the font that will be used. The UNICODE variable specifies the use of utf8 coding. LOGLEVEL defines the level of verbosity during the booting process (1 for least verbose, 7 for most). KEYMAP defines the keyboard mapping. All available keyboard maps are listed in the folder /lib/kbd/keymaps/i386/. Available fonts are listed in the folder /lib/kbd/consolefonts/ .

    The file /etc/X11/xorg.xonf.d/20-keyboard.conf does the same thing for your graphical keyboard. This is a wide subject; please use the Xorg man page for further information on how to configure it. You will also find a lot of examples on the Internet.

  3. The network

    • Automatic configuration:
    • The variable MANAGER in the file /etc/sysconfig/network is not specified. The script taking care of the network will adapt by checking which application is installed. If wicd is found, the wicd service will be started; if networkmanager is found, the networkmanager service will be started. If both applications are installed, networkmanager is started preferentially. If neither is found, the cli script will be started. If you prefer to choose your own configuration mode manually, read the instructions below.
    • Manual configuration:
    • Each network connection is defined in a file ending with the name of the connection device. The name of a network card can be eth0, eth1, etc (usually for a wired connection) or wlan0, wlan1, etc (for a wireless one). To find out the names of the recognised network devices on the system, check the content of the /sys/class/net folder. Use the command
      ls /sys/class/net
      The lo device doesn't have to be configured.

      Example: the file /etc/sysconfig/ifconfig.eth0 defines the configuration of the eth0 device. This first example defines the eth0 wired ethernet card to have a static address. The content of /etc/sysconfig/ifconfig.eth0 will be:

      cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
      ONBOOT=yes
      SERVICE=ipv4-static
      IP=192.168.1.10
      GATEWAY=192.168.1.1
      PREFIX=255.255.255.0
      BROADCAST=192.168.1.255
      EOF
      
      For a static adress configuration, it is necessary to specify the addresses of your DNS servers manually. For example, if you wish to use the google DNS servers, put this in the file /etc/resolv.conf:
      cat > /etc/resolv.conf << "EOF"
      nameserver 8.8.8.8
      nameserver 8.8.4.4
      EOF
      
      You can often use the address of your router, as most routers are also DNS servers.

      The second example shows a dynamic address configuration for wlan0: the content of /etc/sysconfig/ifconfig.wlan0 will be:
      cat > /etc/sysconfig/ifconfig.wlan0 << "EOF"
      ONBOOT="yes"
      SERVICE="dhcpcd"
      DHCP_START=""
      DHCP_STOP="-k "
      # Put PRINTIP="yes" so the script will show the IP addresse
      PRINTIP="no"
      # Put PRINTALL="yes" so that the script shows all details
      # of the connection
      PRINTALL="no"
      EOF
    • Define a wireless network and activate the wpa key
    • If your machine supports wifi, it is necessary to configure it. To know the name of the network card, use the command (as root):
      iwconfig
      If the result is something like:
      eth0       no wireless extensions.
      
      eth1       IEEE 802.11abg 
                 Mode:Managed  Frequency:2.417 GHz  Access Point: C4:3D:C7:9F:D0:CF
                 Tx-Power=200 dBm
                 Retry  long limit:7   RTS thr:off   Fragment thr:off
                 Encryption key:off
                 Power Management:off
      In this example above, the eth1 card supports wifi. We just have to provide the configuration file which will be used by the network connection.

      ATTENTION: it is important to name the configuration file correctly so that the script can find it. In this example, the name of the card is eth1, the name of the wifi network is casabianca and the access key will be Gg6!-@1234. From this information, we create this configuration file:

      wpa_passphrase "casabianca" "Gg6!-@1234" > /etc/wpa_supplicant.conf.eth1
      Then we add the configuration file as explained in the manual configuration section. In this example, we have to create the file /etc/sysconfig/ifconfig.eth1. Once, this is done, you can restart the network by restarting the service:
      /etc/rc.d/init.d/network restart
      Make sure you adjust the definition of the variable MANAGER as defined in the file /etc/sysconfig/network. The management of the network service can be done through the command line. The value of the variable is then cli. If you want to use wicd, put wicd as a value; if networkmanager (which comes with the gnome graphical interface), then put networkmanager.

    • Adding a partition, a disk or a NFS shared folder

    • [NOTE IMPORTANTE] If you have allready defined the user(s) on this machine and wish to mount their /home folder (which contains the users's personal files) on a separate partition/disk/NFS folder, it is important to back up the existing contents of this folder first. There are several ways of doing this. Whichever way you use, make sure you are logged in as root and that the X server is not running.

      As root, type the following commands:

      init 3
      sync
      cd /home
      tar cf /root/users.tar *
      If everything went well (no error messages), you can erase the folders, still as root
      cd /home
      rm -r *
      The home folder is now empty and ready to become a mount point for the real home partition.
      The file /etc/fstab defines the mount points of partition devices when the machine boots. You will probably want to use a partition or a disk or even a NFS folder to store the personal data of the registered users on this machine. In our example, GRUB is on the first partition, NuTyX rootfs is on the second partition, the swap partition is the third. The file /etc/fstab of our example initially contains following information:
      # file/device   mountpoint  type      options    dump fsck order
      ...
      /dev/sda1       /boot       ext2      defaults     0        0
      /dev/sda2       /           reiserfs  defaults     0        1
      /dev/sda3       swap        swap      pri=1        0        0
      We wish to add the second partition (formatted as ext4) of the second disk to be installed on the mount point /home. We need to add the following line:
      echo "/dev/sdb2  /home  ext4     defaults   0   0" >> /etc/fstab
      To add a NFS folder /srv located on a remote server with the IP address 192.168.254.254 to the mounting point /server, we add the following line:
      cat "192.168.254.254:/srv /server  nfs  rw,vers=3,_netdev,rsize=8192,wsize=8192   0   0" \
      >> /etc/fstab
      Once this is done, you can activate the mount points using the command:
      mount -a
      The folder /server must have been created earlier on your local machine. The values of rsize and wsize have the default values. Feel free to experiment with your own values for these. Make sure the package nfs-utils and the associated services are launched. Note that the version 3 of NFS has been chosen.
      You should not see any error messages during the mount operation. You can check the result by using the command:
      mount
      it should return something like this:
      ...
      /dev/sdb2 on /home type ext4 (rw)
      192.168.254.254:/srv on /server type nfs (rw,vers=3,rsize=8192,wsize=8192,addr=192.168.254.254)
      ...
      It is now time to restore the content of the /home folder.
      This assumes that some users are are already created and you choose to mount the /home folder:
      cd /home
      tar xf /root/users.tar
      You can now switch back to graphical mode and login as a normal user.

    • Adding a swap partition or a swap file

    • The command fdisk lets you modify the organisation of your disk(s). If you have less than 1 GB of RAM (for a 32-bit system) or less than 4 GB (for a 64-bit one), you definitely should create a swap partition. If there is no space for another partition, you can still create a swap file and mount it automatically at boot. We first create a file big enough (here +/- 500 MB):
      dd if=/dev/zero of=/SWAP bs=1024 count=500000
      A file named SWAP of 512Mbytes is created in the root directory of the filesystem. Next we format it and make it active:
      mkswap /SWAP
      swapon /SWAP
      Finally we add an entry for it into the /etc/fstab:
      echo "/SWAP     swap       swap     pri=1       0        0" >> /etc/fstab
    • Creating a new user account

    • The command nu (New User) launches a script to add a new user on your system. This user will automatically be added to the essential groups used in NuTyX. If you wish to activate the autologin behavior, edit /etc/lxdm/lxdm.conf file xfce. The more basic commands useradd/userdel can also be used to add/delete users accounts.

    • Setting the clock

    • Under NuTyX, the clock can be set to work in two different ways:
      • Method 1: UTC=1. Use "Coordinated Universal Time". Includes automatic adjustment for summertime (if applicable to your region). Consult the wiki page http://en.wikipedia.org/wiki/Coordinated_Universal_Time for more information.
      • Method 2: UTC=0. Use the local time (as shown by the clock on the wall). This method will not automatically update the clock twice a year. You will have to do that yourself.

      Installation from the live disc will configure the clock using method 1. Installation from the MINI iso will configure the clock using method 2. You can however alter the settings at any time.

      The file /etc/sysconfig/clock defines the clock mode. The file contains just one variable: UTC. If UTC=1 you MUST ensure that the hardware clock is set permanently to Coordinated Universal Time (equivalent to Greenwich Mean Time), and the configuration script will then adjust the desktop time for your chosen locale (Method 1). WARNING: if you choose 1 and you are dual-booting with Microsoft Windows, the time under Windows will be wrong. This OS cannot handle differences between UTC and local time. If UTC=0, both the hardware clock and the desktop clock will show the local time as measured by a wall clock (Method 2). If you want to know the actual setting of your machine, you can check the bios clock setting. As root, launch the command:
      hwclock -rD
      This will show the actual time on the hardware clock, how it is being interpreted (as UTC or as local time), and the resulting corrected time. If the hardware clock before correction matches the wall clock, then the hardware clock is showing local time. You can then confirm it by putting UTC=0 in the file /etc/sysconfig/clock. If the output is different then there is a chance that it is set to show UTC. If the command:
      hwclock -ru
      shows the same as the wall clock, then the clock is correct.

    • Setting the name of your computer

    • The file /etc/sysconfig/network defines the name of the local machine. It also defines which service will be used to configure the network: the default script, wicd or networkmanager. Here is an example of a configuration file:
       HOSTNAME='nutyx'        # The name of your machine
       MANAGER='cli'           # The network manager service (wicd/networkmanager/cli)
       NETWORKWAIT='no'        # Whether or not to wait for the network to come up
       LINKDELAY='15'          # Time delay before initialising the network manager
       NETWORKDELAY='0'        # Time delay after initialising the network before mounting nfs and similar services
    • Language and locale

    • The file /etc/profile.d/i18n.sh defines the language of the user interface.
      The link /etc/localtime defines your time zone. To find out the various possibilities for Europe, for example, use the command:
      ls /usr/share/zoneinfo/Europe
      Then adjust the link to match the city closest to your location. For example, the command:
      sudo ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
      will define Rome as city of your region.

    • Configuring the boot process

    • If you used an ISO image to install NuTyX and you installed GRUB as your bootloader, its configuration file is located in /boot/grub/grub.cfg. The name of the NuTyX kernel file is kernel, and the name of the initrd is initrd. Both files are located in the /boot folder. In the following example, NuTyX is installed on the first partition of the second hard drive and grub is installed on the first hard drive. The configuration file will be:
      menuentry "NuTyX 8.0" {
        set root=(hd1,1)
        linux /boot/kernel root=/dev/sdb1 ro quiet 3
        initrd /boot/initrd
        }
      If we want to have an extra entry for maintenance, the entry will look like:
      menuentry "NuTyX maintenance" {
        set root=(hd1,1)
        linux /boot/kernel ro quiet 3
        initrd /boot/initrd
        }
      Note that this entry doesn't have the option root=/dev/sdb1 so the root partition will not be mounted. This would allow you to carry out maintenance tasks on this partition.
      If the bootloader is not yet installed, (for example because you installed NuTyX from a script rather than from an ISO image), you can install grub separately by specifying the disk on which which the NuTyX partition is located. In our example below, we will use the following command:
      sudo grub-install /dev/sdb
      Ajust according your settings

    • Manual loading of the kernel modules

    • A module is a piece of code used by the kernel which can be loaded while the machine is running. The command:
      lsmod
      lists all the currently loaded modules. The command:
      modprobe-v module
      manually loads the module module into the kernel. The command:
      rmmod -v module
      unloads module from the kernel.

      Sometimes it is necessary to blacklist a module that is causing problems, to prevent it from being loaded automatically. The folder /etc/modprobe.d contains all the files that specify modules to blacklist. File syntax example, the file /etc/modprobe.d/ati.conf contains:

      blacklist radeon
    • Modify/Create folders/files at booting

    The file /etc/sysconfig/createfiles specifies files and/or folders that need to be created or modified automatically when the machine starts. It is unlikely that you will need to adjust these.

  4. IN CASE OF PROBLEMS

  5. If you run into a problem, Linux automatically produces a variety of log files which can provide useful information. There is a record of the boot process in /var/log/boot.log and more complete system messages in /var/log/sys.log. A record of the last start-up of the X server is in the file /var/log/Xorg.0.log. Most of the services have there own logs.If you have a ssh connection problem, some info will be found in the file /var/log/auth.log of the ssh server. To find out about installed binary packages, check the file /var/log/cards.log.

  6. BINARY PACKAGE MANAGEMENT (REMOTE)

    1. Configuration of cards

    2. The file /etc/cards.conf defines the behavior of the cards package manager. Each line in this file is a <variable> <value> pair
    3. Commands to know

    The cards command has a lot of possible options. Only a few are listed here. To get complete help information, use the command:
    cards help
    Any options that modify your installation must be used from the administrator (root) account or via the sudo command.

    Synchronisation, to check the available updates.

    check
    or
    sudo cards sync -i
    Installing package(s)
    get packageX .. packageY
    or
    sudo cards install packageX .. packageY
    Uninstalling a package
    del packageX
    or
    sudo cards remove paquetX
    Updating of the X package. Note that all the dependencies will be updated if necessary.
    up paquetX
    or
    sudo cards install -u packageX
    Searching for a string in the name or description of the available packages.
    search <string>
    or
    sudo cards search <string>
    Print out a list of out-of-date packages. This will also show packages which have been locked to prevent them from being upgraded automatically.
    sudo cards diff -i
  7. BINARY PACKAGE MANAGEMENT (LOCAL) (advanced mode user)

  8. To manage local binary packages, we use the commands pkgadd, pkgrm, and pkginfo. These commands modify your installation, so they need root access.(su -)
    To get access to thoses commands, you need to install the cards.devel package:
    get cards.devel
    1. Configuration of pkgadd

    2. The file /etc/pkgadd.conf defines the installation and upgrade rules for binary packages. It contains three columns: EVENT, PATTERN and ACTION. The EVENT column describes the type of situation to which this rule applies. Currently there are two types of events: UPGRADE and INSTALL. UPGRADE rules are applied when a package is installed over an existing version, and INSTALL rules are applied in all cases. The pattern is a regular expression representing a class of files. The action applicable to both the UPGRADE and INSTALL event is YES and NO. More than one rule of the same event type is allowed, in which case the first rule will have the lowest priority and the last rule will have the highest priority. Example:
      UPGRADE         ^etc/.*$                NO
      UPGRADE         ^var/log/.*$            NO
      UPGRADE         ^etc/X11/.*$            YES
      UPGRADE         ^etc/X11/XF86Config$    NO
      The above example will prevent pkgadd from upgrading anything in /etc/ or /var/log/ (subdirectories included), except files in /etc/X11/ (subdirectories included). However the file /etc/X11/XF86Config is not to be updated. The default rule is to upgrade/install everything, rules in this file are exceptions to that rule. (NOTE! A pattern should never contain an initial "/" since you are referring to the files in the package, not the files on the disk.) If pkgadd finds that a specific file should not be upgraded it will install it under /var/lib/pkg/rejected/. The user is then free to examine/use/remove that file manually.
    3. Commands to knows

    Install a local package
    sudo pkgadd /path/to/package
    Upgrade a local package
    sudo pkgadd -u /path/to/package
    Delete the package silently
    sudo pkgrm package
    List all the installed packages
    pkginfo -i
    List the file list of a package
    pkginfo -l package
    Find out the owner of a filename
    pkginfo -o FileName
  9. PACKAGE MANAGEMENT USING PORTS WITH DEPENDENCY MANAGEMENT (for advanced users)

  10. The management of recipes for packages and their dependencies is carried out using the cards command as well.
    1. cards configuration

    2. As mentioned above, the /etc/cards.conf file defines rules for this command. The line dir /var/lib/pkg/houaphan/... is very important for ports management. The order defines the order in which directories will be searched for recipes. If a recipe is available in two directories, the first one listed will always be used.
    3. Commands you need to know

    List dependencies of a package and see if they are installed.
    cards deptree package
    Check if package is available
    cards search package
    Search a package with the description
    cards info -p package
    Build and install a port (needs root access)
    cd /var/lib/pkg/houaphan/<collection>/packageX && pkgmk -d -i
    Download, build and install the package in one single command
    sudo cards create -n packageX
    Download, build and install the package. Its dependencies MUST be available already. They will not be compiled.

  11. SERVICES

  12. Various service packages are available for installation under the name <nameoftheservice>.service. The command cards search service will printout the list of all available service packages. Once installed, their start-up scripts (cups, gdm, sshd, etc...) can be found in the /etc/rc.d/init.d directory
    Example: Starting the X service
    /etc/rc.d/init.d/Xservice start
    Stopping the X service
    /etc/rc.d/init.d/Xservice stop
    Restarting the service (this option is not available for all services).
    /etc/rc.d/init.d/Xservice restart
  13. ONLINE HELP

  14. IRC: join the chat room #nutyx on the irc.freenode.net (utf-8) network (mostly after 8PM Paris Local Time)
    WEB site: http://www.nutyx.org
    User's Forums http://forums.nutyx.org
  15. FILES

  16. Here are listed the configuration files mentioned in this manual. You may like to study them for yourself.

    /var/lib/pkg/nutyx-version,
    /etc/cards.conf,
    /etc/pkgadd.conf,
    /etc/pkgmk.conf,
    /etc/sysconfig/console,
    /etc/sysconfig/clock,
    /etc/sysconfig/network,
    /etc/wpa_supplicant.conf.*,
    /etc/sysconfig/ifconfig.*,
    /boot/grub/grub.cfg,
    /etc/fstab,
    /etc/profile.d/i18n.sh
  17. AUTHORS

  18. Thierry Nuttens <tnut ~AT~ nutyx dot org>
  19. SEE ALSO

  20. man pages of
    nutyx(8), cards(8), pkgmk(8) pkgadd(8),
    cards.conf(5), pkgmk.conf(5), pkgrm(8), pkginfo(8), modprobe(8), modprobe.conf(5),
    useradd(8), userdel(8)
  21. COPYRIGHT

  22. Copyright (C) 2013 - 2016 Thierry Nuttens
    
    This free document is published under the free license WTFPL - Do What The F*** You Want To Public License.
    ( http://www.wtfpl.net/ )