SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:handbook:systemutils [2015/01/02 19:25]
linea Tiny edits
en:handbook:systemutils [2022/08/13 17:26] (current)
linea
Line 3: Line 3:
 ===== Devices and disk access ===== ===== Devices and disk access =====
  
-With Linux your disks and USB media are seen as devices. To access them you must first mount a device on a mount point (directory). On SliTaz ​you can graphically mount devices ​by using mountbox ​or the command ​line. To mount the first disk of a local hard disk on ///mnt/disk//:+With Linux disks and USB media are seen as devices. To access ​data on thema device ​first must be mounted ​on a mount point (directory). 
 + 
 +On SliTaz devices ​can be mounted ​using a program with a graphical user interface, like ''​pcmanfm'' ​or with a command ​from a terminal. 
 + 
 +To mount the first partition ​of a local disk on ''​/mnt/disk''​:
  
 <​code>​ <​code>​
  # mkdir -p /mnt/disk  # mkdir -p /mnt/disk
- # mount /dev/hda1 /mnt/disk+ # mount /dev/sda1 /mnt/disk
 </​code>​ </​code>​
  
-To mount a cdrom or an USB media you should use mount points located in ///media//. Note that for a cdrom, you just have to specify the device path. For a flash key, the mount point already exists:+To mount an optical disk or an USB medium, ​mount points located in ''​/media''​ should be used. 
 + 
 +Note that for an optical disk, you just have to specify the device path. For a flash key, the mount point already exists:
  
 <​code>​ <​code>​
Line 19: Line 25:
 === NTFS filesystem === === NTFS filesystem ===
  
-If you need read/write access to Windows ntfs filesystems ​you must install ​a few additional packages from the mirror. The ntfs-3g driver provides stable access to ntfs partitions and ntfsprogs provides manipulation tools dependent on fuse. Note that you can formatmove or resize ntfs partitions graphically with Gparted.+If read or write access to Windows ntfs filesystems ​is needed, ​a few additional packages from the repository must be installed. 
 + 
 +The ''​ntfs-3g'' ​driver provides stable access to ntfs partitions and ''​ntfsprogs'' ​provides manipulation tools dependent on fuse. 
 +Note that ntfs partitions ​can be formattedmoved or resized using Gparted, a GUI to parted.
  
 === NFS === === NFS ===
  
-NFS (Network File System) is the native ​unix/​linux ​method for sharing file systems. In this respect its function is similar to samba. The most popular version is still NFSv3 which is able to use either ​UDP or TCP as the network protocol. The older NFSv2 was only capable of using UDP. On a local LAN, UDP is still the fastest protocol; TCP is to be preferred when the machines are connected over a WAN. +NFS (Network File System) is the native ​UNIX and Linux method for sharing file systems. 
 +In this respect its function is similar to Samba. 
 + 
 +The most popular version is still NFSv3which is able to use UDP or TCP as the network protocol. 
 + 
 +The older NFSv2 was only capable of using UDP. 
 + 
 +On a LAN, UDP is still the fastest protocol; TCP is to be preferred when the machines are connected over a WAN.  
 NFSv3 has been superseded by NFS version4 which has notable improvements (security) over v3 but its configuration has become a lot more complex as a result. ​ NFSv3 has been superseded by NFS version4 which has notable improvements (security) over v3 but its configuration has become a lot more complex as a result. ​
  
-An NFS server exports a part of it's file system; i.e. makes it available on the network. The server is configured with details about client ip addresses or host names and can restrict their access to the file system. Access can be read-only, read-write or no access at all. +An NFS server exports a part of it's file system; i.e. makes it available on the network. 
 +The server is configured with details about client ip addresses or host names and can restrict their access to the file system. 
 +Access can be read-only, read-write or no access at all. 
 An NFS client simply mounts the exported file systems as if they were local devices. ​ An NFS client simply mounts the exported file systems as if they were local devices. ​
  
-The NFS software in Slitaz makes it possible to run both as a server or a client. To start the NFS processes, you need to run the init script in etc/init.d/ +The NFS software in Slitaz makes it possible to run both as a server or a client. 
-<​code>/​etc/​init.d/​nfsd start|stop</​code>​+To start the NFS processes, you need to run the init script in ''/​etc/init.d/'':​ 
 +<​code>/​etc/​init.d/​nfsd start|stop|restart</​code>​
 <note tip>The NFS daemons must be running also when the machine acts as a client.</​note>​ <note tip>The NFS daemons must be running also when the machine acts as a client.</​note>​
  
Line 37: Line 57:
 <​code>​ <​code>​
 # tazpkg -l | grep nfs # tazpkg -l | grep nfs
-linux-nfsd ​             ​2.6.37            ​base-system +linux-nfsd ​             ​3.16.55           base-system 
-nfs-utils ​              1.2.            system-tools+nfs-utils ​              2.6.1             system-tools
 </​code>​ </​code>​
  
 Install them using: Install them using:
 <​code>​ <​code>​
-# tazpkg -gi linux-nfsd nfs-utils+# tazpkg -gi linux-nfsd 
 +# tazpkg -gi nfs-utils
 </​code>​ </​code>​
  
Line 61: Line 82:
 /usb1           ​192.168.1.0/​24(rw,​sync,​no_subtree_check) /usb1           ​192.168.1.0/​24(rw,​sync,​no_subtree_check)
 </​code>​ </​code>​
-The server is only exporting one drive: usb1. Clients must be in the 192.168.1.0/​24 network and they have read-write access.+The server is only exporting one filesystem: usb1. Clients must be in the 192.168.1.0/​24 network and they have read-write access.
  
 To use nfs on the client; all you need to do is start nfsd and mount the share: To use nfs on the client; all you need to do is start nfsd and mount the share:
 <​code>​ <​code>​
 # /​etc/​init.d/​nfsd start # /​etc/​init.d/​nfsd start
 +# mkdir /​mnt/​usbdrive1
 # mount server:/​usb1 /​mnt/​usbdrive1 # mount server:/​usb1 /​mnt/​usbdrive1
 </​code>​ </​code>​
-Please note the specific format for nfs shares ​**servername** colon slash-mountpoint**. +Please note the specific format for nfs shares ​''//​server//'':''//​mountpoint//''​.
-Naturally you must also make sure that the specified mount point (directory) exists on the client+
  
 ===== Users, groups and passwords ===== ===== Users, groups and passwords =====
  
-To manage users and groups on your SliTaz system ​you must use the command line, but file permissions can be changed ​graphically using the PCmanFM ​file managerTo add or remove users and groups ​you must be rootRoot can also change all user passwords ​and single ​user can only change his/her own password. ​To add or remove a user named linux:+To manage users and groups on SliTaz systemthe command line must be used, but file permissions can be changed ​with a GUI, PCmanFM ​for example. 
 +Only the system administrator (''​root''​) can add or remove users and groups. ​The system administrator ​can also change ​**all** user passwords
 +nonprivileged ​user can only change his or her own password.
  
 +To add or remove a user named linux:
 <​code>​ <​code>​
  # adduser linux  # adduser linux
Line 81: Line 105:
  
  
-=== Manipulating users group membership===+=== Manipulating users and group membership ===
  
-Linux groups are a mechanism to manage a collection of computer system users. All Linux users have a user ID and a group ID and a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. Groups can be assigned to logically tie users together for a common security, privilege and access purpose. It is the foundation of Linux security and access. Access to files and devices may be granted based on a user ID or a group ID. This mechanism is the same for all of linux but the way it is configured varies per distribution. Sometimes additional or different commands are used, like for example usermod, chgrp, useradd or groupadd. Below is an overview of how to handle users, groups and group membership on Slitaz. ​+Linux groups are a mechanism to manage a collection of computer system users. 
 +All Linux users have a user name and a group name and a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. 
 +Groups can be assigned to logically tie users together for a common security, privilege and access purpose. 
 +It is the foundation of Linux security and access. 
 +Access to files and devices may be granted based on a userid ​or a groupid. 
 +This mechanism is the same for all of linux but the way it is configured varies per distribution. 
 +Sometimes additional or different commands are used, like for example ​''​usermod''​''​chgrp''​''​useradd'' ​or ''​groupadd''​. 
 +Below is an overview of how to handle users, groups and group membership on Slitaz. ​
  
-The Slitaz way is using only four commands. Simple ​Elegant. ;-)+The Slitaz way is using only four commands. Simple ​and Elegant. ;-)
  
 <​code>​ <​code>​
Line 103: Line 134:
 </​code>​ </​code>​
  
-Any user can be member of any group and the combination of user group permissions allows for granular access to system resources. ​+Any user can be member of any group and the combination of user and group permissions allows for granular access to system resources. ​
  
 === Passwd === === Passwd ===
Line 110: Line 141:
  
 <​code>​ $ passwd <​code>​ $ passwd
- # passwd username </​code>​+ # passwd ​<username</​code>​
  
 === Audio group === === Audio group ===
  
-If you want a new user to be able to listen to music he must be in the audio group. To add an existing user to the audio group:+If you want a new user to be able to listen to music he must be in the group ''​audio''​. 
 + 
 +To add an existing user to the group audio: 
 + 
 +<​code>​ # adduser -G audio <​username>​ </​code>​
  
-<​code>​ # adduser -G audio user_name </​code>​ 
 ===== Language and keyboard layout ===== ===== Language and keyboard layout =====
  
-SliTaz saves the configuration of the default locale in ///​etc/​locale.conf// which is read by ///​etc/​profile// on each login and the keyboard setting is stored in ///etc/kmap.conf//. These two files can be edited with your favorite editor or configured respectively with //tazlocale// and //tazkeymap//. You can modify the settings you chose on the first boot by typing as root administrator:​+SliTaz saves the configuration of the default locale in ''​/​etc/​locale.conf'' ​which is read by ''​/​etc/​profile'' ​on each login 
 +and the keyboard setting is stored in ''​/etc/keymap.conf''​. 
 +These two files can be edited with your favorite editor or configured respectively with ''​tazlocale'' ​and ''​tazkeymap''​. 
 +You can modify the settings you choose ​on the first boot by typing as system ​administrator:​
  
-<​code>​ # tazlocale+<​code>​ 
 + # tazlocale
  Or:  Or:
- # tazkeymap </​code>​ + # tazkeymap 
- +</​code>​
-To check all available locales or your current configuration,​ you can use the command locale as a single user or root (C for English):+
  
 +To check all available locales or the current configuration,​ the command ''​locale''​ can be used:
 <​code>​ <​code>​
  $ locale -a  $ locale -a
Line 132: Line 170:
 </​code>​ </​code>​
  
-===== Custom ​SHell =====+===== Custom ​Shell ===== 
 + 
 +SliTaz uses the shell provided by busybox linked to ''​sh''​. It is light, fast and standards compliant. 
 +To change the default shell for a user, the corresponding field in the user's line in ''/​etc/​passwd''​ can be modified with a text editor.
  
-SliTaz uses the ash shell linked to sh provided by busybox. Ash is light, fast and standards compliant. To change the default shell for a user you can edit the /etc/passwd file using the corresponding line. After you login, /​etc/​profile is read first and then the user file ~/​profile. ​You can edit these files with a text editor to configure the language, any aliases, etc. +After login, ​''​/​etc/​profile'' ​is read first and then the user file ''​~/.profile''​. 
 +These files can be edited ​with a text editor to configure the language, any aliases, etc.
  
 === Example: ~/.profile === === Example: ~/.profile ===
Line 152: Line 194:
 ===== Bash Shell ===== ===== Bash Shell =====
  
-On SliTaz you have the ash and sh shell with a link to Ash, this shell is provided by Busybox. ​If you wish to use the Bash (Bourne Again SHell), first as root install bash, copy the //​.profile//​ found in your home directory and rename it //​.bashrc//,​ then edit the ///etc/passwd// file with your favorite text editor and change ​your shell to :///bin/bash//+If you wish to use the Bash (Bourne Again SHell), first as system administrator ​install bash
 +Then the system administrator must edit ''​/etc/passwd''​ to change ​the user'​s ​shell to ''​/bin/bash''​. 
 +Finally copy ''​~/.profile''​ to ''​~/.bashrc''​.
  
 <​code>​ <​code>​
  # tazpkg get-install bash  # tazpkg get-install bash
- # cp /​home/​hacker/​.profile home/​hacker/​.bashrc 
- Note root user: cp /​home/​hacker/​.profile ~/.bashrc 
  # nano /​etc/​passwd ​  ~ :/bin/bash  # nano /​etc/​passwd ​  ~ :/bin/bash
 + ​hacker:​~$ cp .profile .bashrc
 </​code>​ </​code>​
  
-The next time you login bash will be your default shell, you can confirm ​this by typing env on the command line.+The next time ''​hacker''​ logs in, bash will be the default shell
 +this can be confirmed ​by typing ​''​env'' ​on the command line and inspecting the ''​SHELL''​ variable.
  
 ===== Editors ===== ===== Editors =====
  
-Busybox supplies a clone of vi for normal text editing, but it does have its limitations. ​You can install the full vim editor with the command: +Busybox supplies a clone of vi for normal text editing, but it does have its limitations. ​The full vim editor ​can be installed ​with:
 <​code>​ # tazpkg get-install vim </​code>​ <​code>​ # tazpkg get-install vim </​code>​
  
-Or alternatively if you prefer emacs, SliTaz offers a tiny version: +Or alternatively if you prefer emacs:
 <​code>​ # tazpkg get-install emacs </​code>​ <​code>​ # tazpkg get-install emacs </​code>​
  
 ===== Sudo ===== ===== Sudo =====
  
-The sudo command can be applied ​on SliTaz: +The sudo command can be installed ​on SliTaz:
 <​code>​ # tazpkg get-install sudo </​code>​ <​code>​ # tazpkg get-install sudo </​code>​
  
-Note that the configuration file ///​etc/​sudoers//, should always be edited by the //visudo// command which locks the file and checks for errors.+Note that the configuration file ''​/​etc/​sudoers''​, should always be edited by the ''​visudo'' ​command which locks the file and checks for errors.
  
 ===== System Time ===== ===== System Time =====
  
-To check the current system time, you can simply type: <​code>​$ date </​code>​+To check the current system time, you can simply type: 
 +<​code>​$ date </​code>​
  
 === TimeZone === === TimeZone ===
-On SliTaz, the timezone configuration ​file is saved in ///etc/TZ//, you can edit this with your favorite ​text editor or simply ​echo the changesTo view the available timezones, you can look in the ///​usr/​share/​zoneinfo// directory. Here's an example using the timezone Europe/​London:​+On SliTaz, the timezone configuration is saved in ''​/etc/TZ''​. 
 +This file can be edited ​with text editor or simply the echo command. 
 +The available timezones ​are to be found in the ''​/​usr/​share/​zoneinfo'' ​directory. 
 + 
 +Here's an example using the timezone Europe/​London:​
  
 <​code>​ # echo "​Europe/​London"​ > /etc/TZ </​code>​ <​code>​ # echo "​Europe/​London"​ > /etc/TZ </​code>​
Line 192: Line 238:
 === Rdate === === Rdate ===
  
-To synchronize the system clock with a network time server, ​you can (as root) use the //rdate -s// command: +To synchronize the system clock with a network time server, ​the system administrator ​can use the ''​rdate -s'' ​command:
 <​code>​ # rdate -s tick.greyware.com </​code>​ <​code>​ # rdate -s tick.greyware.com </​code>​
  
-To display the time on the remote server, use the //rdate -p// command+To display the time on the remote server, use the ''​rdate -p'' ​command:
 <​code>​ $ rdate -p tick.greyware.com </​code>​ <​code>​ $ rdate -p tick.greyware.com </​code>​
  
-=== Using ntp ===+=== Using NTP === 
 + 
 +NTP is a protocol to synchronize the time on many different systems via a network. 
 +NTP is a client-server application which uses UDP port 123. 
 +This section describes how to configure a system as an NTP client, deriving its time from the Internet. 
 +There are many servers available on the Internet which provide a NTP service.  
 +<note tip> Experience has shown that NTP servers seldom have a high availability,​ rather the opposite! 
 +This means it may not be such a good idea to configure a particular server as a time source, not even two or three. 
 +After a while none of them might be active any more and time is drifting freely! 
 +A better way is to use the service from ntp.org ( http://​www.ntp.org/​ ). 
 +They provide pools of NTP servers per country or region. 
 +Selecting one of these provides a more reliable connection to a NTP time source. 
 +</​note>​
  
-NTP is a protocol to synchronize the time on many different systems via a network. NTP is a client-server application which uses UDP port 123. This section describes how to configure your system as an ntp client deriving its time from the Internet. There are many servers available on the Internet which provide an ntp service. ​ 
-<note tip> Experience has shown that ntp servers seldom have a high availability,​ rather the opposite! This means it may not be such a good idea to configure a particular server as your time source, not even two or three. After a while you may find out that none of them is active any more and your time is drifting freely! A better way is to use the service from ntp.org.( http://​www.ntp.org/​ ) They provide pools of ntp servers per country or region. Selecting one of these provides a more reliable connection to an ntp time source. </​note>​ 
  
 +Although Slitaz is a small distribution,​ it provides several NTP implementations.
  
-Although Slitaz is a small distribution,​ it provides several ntp implementations. ​Most notably: ​+Most notably: ​
  
 1: busybox ntpd (included in the base installation). Using busybox ntpd from the command line: 1: busybox ntpd (included in the base installation). Using busybox ntpd from the command line:
Line 215: Line 270:
  
 2: ntp.tazpkg (install from packages repository). To install ntp.tazpkg: ​ 2: ntp.tazpkg (install from packages repository). To install ntp.tazpkg: ​
-<​code>​ # tazpkg -gi ntp </​code>​  +<​code>​ # tazpkg ​get-install ​ntp </​code>​  
-This package includes a decent set of ntp related binaries ​the config ​file /​etc/​init.d/​ntp+This package includes a decent set of ntp related binaries ​and the configuration ​file ''​/​etc/​init.d/​ntp''​
 <​code>​ <​code>​
 # tazpkg list-files ntp # tazpkg list-files ntp
Line 224: Line 279:
 /​etc/​init.d/​ntp /​etc/​init.d/​ntp
 /​etc/​ntp.conf /​etc/​ntp.conf
 +/​usr/​bin/​calc_tickadj
 +/​usr/​bin/​ntp-keygen
 +/​usr/​bin/​ntp-wait
 /​usr/​bin/​ntpd /​usr/​bin/​ntpd
 /​usr/​bin/​ntpdate /​usr/​bin/​ntpdate
 /​usr/​bin/​ntpdc /​usr/​bin/​ntpdc
-/​usr/​bin/​ntp-keygen 
 /​usr/​bin/​ntpq /​usr/​bin/​ntpq
 /​usr/​bin/​ntptime /​usr/​bin/​ntptime
 /​usr/​bin/​ntptrace /​usr/​bin/​ntptrace
-/​usr/​bin/​ntp-wait 
 /​usr/​bin/​sntp /​usr/​bin/​sntp
 /​usr/​bin/​tickadj /​usr/​bin/​tickadj
 +/​usr/​bin/​update-leap
 </​code>​ </​code>​
-Be aware that Slitaz has several ​ntp daemons available. We have the Busybox app but also the ntp package. Both provide virtually the same functionality. If you have limited resources, the busybox version can provide all you need. If you want all the diagnostic stuff as well, you should rather go for installing ntp.tazpkg.+Be aware that Slitaz has several ​NTP daemons available. 
 +We have busybox ntp but also the ntp package. Both provide virtually the same functionality. 
 +If you have limited resources, the busybox version can provide all you need. 
 +If you want all the diagnostic stuff as well, you should rather go for installing ntp.tazpkg.
  
 === Starting ntpd at boot === === Starting ntpd at boot ===
  
-Probably the easiest way to start busybox ntpd at boot is to add an entry like above to /​etc/​init.d/​local.sh. The explanation below focuses on ntp.tazpkg. It is unclear which one was intended by the developers to be started by the Server Manager. This can be somewhat confusing. The verified way to configure the ntp daemon is to use the command line as detailed below.+Probably the easiest way to start busybox ntpd at boot is to add an entry like above to ''​/​etc/​init.d/​local.sh''​. 
 +The explanation below focuses on ntp.tazpkg. 
 +It is unclear which one was intended by the developers to be started by the Server Manager. 
 +This can be somewhat confusing. The verified way to configure the NTP daemon is to use the command line as detailed below.
  
-To start /​usr/​bin/​ntpd (ntp.tazpkg) at boot:+To start ''​/​usr/​bin/​ntpd'' ​(from ntp.tazpkg) at boot:
  
 1: Make sure to install the package as shown above ;-). 1: Make sure to install the package as shown above ;-).
  
-2: Edit /​etc/​daemons.conf as follows:+2: Edit ''​/​etc/​daemons.conf'' ​as follows:
 <​code>​ <​code>​
 Add one line at the end:  Add one line at the end: 
Line 251: Line 314:
 </​code>​ </​code>​
  
-<note tip>​The ​ntp daemon ​gets it options from /​etc/​daemons.conf. The configuration file /​etc/​ntp.conf which is referred to by the Server Manager seems to be unused and may be deleted.</​note>​+<note tip> 
 +The NTP daemon ​reads it'​s ​options from **/​etc/​daemons.conf**. 
 +The configuration file **/​etc/​ntp.conf**, which is referred to by the Server Manager seems to be unused and may be deleted. 
 +</​note>​
  
-3: Edit /​etc/​rcS.conf as follows:+3: Edit ''​/​etc/​rcS.conf'' ​as follows:
 <​code>​ <​code>​
 On the line with daemons to start, add ntp to the list: On the line with daemons to start, add ntp to the list:
- ​RUN_DAEMONS="​inetd dbus hald slim firewall httpd ntp " ​+ ​RUN_DAEMONS="​inetd dbus hald slim firewall httpd ntp" ​
 </​code>​ </​code>​
-<note tip> Make sure to enter just ntp, not ntpd! The name is a reference to /​etc/​init.d/​ntp </​note>​ +<note tip> 
-These are the required steps. ​After completion, you may reboot ​to verify everything is indeed working as expected. ​+Make sure to enter just ntp, not ntp**d**! The name is a reference to **/​etc/​init.d/​ntp** 
 +</​note>​ 
 +These are the required steps. ​Reboot ​to verify everything is indeed working as expected. ​
  
 Use the following to check if the daemon is running: Use the following to check if the daemon is running:
Line 269: Line 337:
 In this example, the first line shows the process we want to see. In this example, the first line shows the process we want to see.
  
-<note tip>Use /​etc/​init.d/​ntp {start | stop | restart} to control the ntp daemon or specify the full path(/​usr/​bin/​ntpd) Using ntpd on the command line without the full path causes the busybox version to be invoked.</​note>​+<note tip> 
 +Use **/​etc/​init.d/​ntp {start | stop | restart}** to control the NTP daemon or specify the full path (/​usr/​bin/​ntpd)
 +Using ntpd on the command line without the full path causes the busybox version to be invoked
 +</​note>​
  
  
 === Verifying ntpd operation === === Verifying ntpd operation ===
  
-You may use //ntpq// to verify ​your connection ​to ntp servers+The ''​ntpq''​ command can be used to verify ​connections ​to NTP servers
 <​code>​ <​code>​
 # ntpq -p nl.pool.ntp.org # ntpq -p nl.pool.ntp.org
Line 286: Line 357:
 </​code>​ </​code>​
  
-The * at the start of a line indicates the server ​you are currently synchronized to. +The * at the start of a line indicates the server ​the system is currently synchronized to. 
  
 The column "​st"​ shows the stratum or quality of the time source. 1 is best, 16 means unavailable. The column "​st"​ shows the stratum or quality of the time source. 1 is best, 16 means unavailable.
-Important to check are the columns "​reach"​ and those behind. Reach should be 377, everything else means polls were missed. ​Your daemon should be running for a while to get reliable output.+ 
 +Important to check are the columns "​reach"​ and those behind. Reach should be 377, everything else means polls were missed. 
 +The NTP daemon should be running for a while to get reliable output.
  
 === Hwclock === === Hwclock ===
  
-//Hwclock// allows you to synchronize ​the time of your hardware clock to the system clock or vice versa.+The ''​hwclock''​ command enables synchronisation of the time of the hardware clock to the system clock or vice versa.
  
-Synchronize ​the system clock to the hardware clock (<​nowiki>​ --utc = universal time, -l = local time </​nowiki>​):​+Synchronise ​the system clock to the hardware clock (<​nowiki>​ --utc = universal time, -l = local time </​nowiki>​):​
  
 <​code>​ # hwclock -w --utc </​code>​ <​code>​ # hwclock -w --utc </​code>​
  
-Synchronize ​the hardware clock to the system clock:+Synchronise ​the hardware clock to the system clock:
  
 <​code>​ # hwclock -s --utc </​code>​ <​code>​ # hwclock -s --utc </​code>​
  
 <​code>​ hwclock -u, --utc | -l, --localtime </​code>​ <​code>​ hwclock -u, --utc | -l, --localtime </​code>​
-Indicates that the Hardware Clock is kept in Coordinated Universal Time or local time, respectively. It is your choice whether to keep your clock in UTC or local time, but nothing in the clock tells which you've chosen. So this option is how you give that information to hwclock+Indicates that the hardware clock is kept in Coordinated Universal Time or local time, respectively. 
-If you specify ​the wrong one of these options (or specify ​neither and take a wrong default), both setting and querying of the Hardware Clock will be messed up. +It is the choice ​of the system administrator, ​whether to keep the clock in UTC or local time, but nothing in the clock tells which is choosen. 
 +So this option is how to give that information to the hardware clock
 +If the wrong one of these options ​is specified ​(or neither and a wrong default ​is taken), 
 +both setting and querying of the hardware clock will be messed up.
  
-<​note>​On slitaz, ​hwclock ​must always be set to UTC. The result of a non-UTC hardware clock setting is an incorrect time for your timezone.</​note>​+<​note>​ 
 +On slitaz, ​the hardware clock must always be set to UTC. 
 +The result of a non-UTC hardware clock setting is an incorrect time for the timezone. 
 +</​note>​
  
-=== Synchronizing ​the hwclock ​with ntp ===+=== Synchronising ​the hardware clock with NTP ===
  
-There are several ways to set the hardware clock to ntp time:  +There are several ways to set the hardware clock to NTP time:  
-<​code>​ # busybox ntpd -dnqp nl.pool.ntp.org && hwclock -w -u </​code>​+<​code>​ 
 + # busybox ntpd -dnqp nl.pool.ntp.org && hwclock -w -u 
 +</​code>​
 OR: OR:
-<​code>#​ ntpdate -u nl.pool.ntp.org && hwclock -w -u </​code>​+<​code>​ 
 + # ntpdate -u nl.pool.ntp.org && hwclock -w -u 
 +</​code>​
  
 Alternative three: (quite old, may not work on all servers) Alternative three: (quite old, may not work on all servers)
-<​code>#​ rdate -s nl.pool.ntp.org && hwclock -w -u </​code>​+<​code>​ 
 +# rdate -s nl.pool.ntp.org && hwclock -w -u 
 +</​code>​
  
-Note that in all examples ​we used the -u option to set hwclock ​to UTC time.+Note that in all examples the ''​-u'' ​option ​is used to set the hardware clock to UTC time.
  
-Further reading: ​http://​linux.die.net/​man/​8/​hwclock+Further reading: ​https://​linux.die.net/​man/​8/​hwclock
  
 ===== Execute scheduled commands ===== ===== Execute scheduled commands =====
  
-The daemon '​crond'​ allows ​you to run commands automatically at a scheduled specific date or time. This is very useful for routine tasks such as system administration. The directory cron uses is ///​var/​spool/​cron/​crontabs//.+The daemon ​''crond'' allows to run commands automatically at a scheduled specific date or time. 
 +This is very useful for routine tasks such as system administration. 
 +The directory ​''​cron'' ​uses is ''​/​var/​spool/​cron/​crontabs''​.
  
-Each user on the system ​can have his/her own tasksthey are defined in the file: ///​var/​spool/​cron/​crontabs/​user//​. ​You must be root to edit this file. The crontab utility allows ​you (amongst other things), to list the tasks specific to the user. +Each user can have his or her own tasksthey are defined in the file ''​/​var/​spool/​cron/​crontabs///user//''​. 
 +This file can be created ​to order modified by any user with the ''​crontab -e''​ command, using the user's default text editor. 
 +The crontab utility allows (amongst other things), to list the user'​s ​tasks:
 <​code>​ <​code>​
 # crontab -l <== To list the crontab for user root. # crontab -l <== To list the crontab for user root.
 OR: OR:
 # crontab -l -u tux <== To list the crontab for another user. # crontab -l -u tux <== To list the crontab for another user.
 +OR:
 +tux:~$ crontab -l <== To list the crontab for user tux.
 </​code>​ </​code>​
  
Line 338: Line 429:
 <​file>​ mm hh dd MMM DDD command > log </​file>​ <​file>​ mm hh dd MMM DDD command > log </​file>​
  
-We will create a file with root privileges ​and test the daemon '​crond'​ with a task performed every minute - writing the date to a file ///​tmp/​crond.test//. It should be noted that the utility has an option crontab for editing cron file using 'vi', this is not provided by SliTazIn its place you can use GNU nano (<​Ctrl+X>​ to save & exit):+We will create a crontab ​file and test the daemon ​''crond'' with a task performed every minute - writing the date to a file ''​/​tmp/​crond.test''​.
  
-<​code> ​# nano /​var/​spool/​cron/​crontabs/​root ​</​code>​ +<​code> ​$ crontab -e</​code>​
- +
-Add the line:+
  
 +Insert the line:
 <​file>​ * * * * * date >> /​tmp/​crond.test </​file>​ <​file>​ * * * * * date >> /​tmp/​crond.test </​file>​
 +save and exit the editor.
  
-Launch crond with the option //-b// (background),​ configured via ///​etc/​daemons.conf//​ and using the startup script: +When the system administrator has launched ''​crond'' ​using the startup script:
 <​code>​ # /​etc/​init.d/​crond start </​code>​ <​code>​ # /​etc/​init.d/​crond start </​code>​
 +after a few minutes the contents of the file: ''/​tmp/​crond.test''​ can be viewed:
  
-You can wait a few minutes and view the contents of the file: ///​tmp/​crond.test/​/... OK:+<​code>​ $ cat /​tmp/​crond.test ​</code>
  
-<​code>​ # cat /​tmp/​crond.test </​code>​ +To stop or restart the daemon ​''​crond''​:
- +
-To stop or restart the daemon crond:+
  
 <​code>​ <​code>​
Line 364: Line 453:
 === Invoke the daemon crond on every boot === === Invoke the daemon crond on every boot ===
  
-To launch the daemon '​crond'​ each time you boot the system, just add it to the variable START_DAEMONS in the configuration file ///​etc/​rcS.conf//, either before or after the web server or SSH server.+To launch the daemon ​''crond'' each time the system ​is booted, just add it to the variable START_DAEMONS in the configuration file ''​/​etc/​rcS.conf''​, 
 +either before or after the web server or SSH server. 
 ===== Add commands to be executed at boot ===== ===== Add commands to be executed at boot =====
  
-During the boot process, various scripts are executed to configure services, such as the start of the web server, networking, etc. On SliTaz there is a script ​///​etc/​init.d/​local.sh// which allows ​you to add commands to be launched at system startup. ​You can also create ​new scripts in ///etc/init.d//, their links in ///​etc/​rc.scripts//​ for shell scripts and use// /etc/rc.d// for links to the startup script daemon in /etc/rcS.conf:+During the boot process, various scripts are executed to configure services, such as the start of the web server, networking, etc. 
 +On SliTaz there is a script ​''​/​etc/​init.d/​local.sh'' ​which allows to add commands to be launched at system startup. 
 +Also new scripts ​can be created ​in ''​/etc/init.d''​.
  
 <​code>​ # nano /​etc/​init.d/​local.sh </​code>​ <​code>​ # nano /​etc/​init.d/​local.sh </​code>​
  
 
en/handbook/systemutils.1420223124.txt.gz · Last modified: 2015/01/02 19:25 by linea