How does the Synology Linux implementation work, e.g. bootup, device management etc: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>RobinGB
mNo edit summary
imported>RobinGB
Line 16: Line 16:


===What happens when you log in to the Command Line Interface===
===What happens when you log in to the Command Line Interface===
When you log in to the Comand Line Interface (via either SSH or Telnet) as a user (usually root) the NAS creates a ptty ash shell for you and drops you into that users "home" directory as defined in the file "/etc/passwd". If the home directory contains a file ".profile" (synology use one for the user "root" it is "/root/.profile") this is read and actioned setting environment variables, such as path, alias's, prompt etc. You can add to this file to run scripts or set parameters when you log in using the CLI.
For CS407 fw598 when you log in to the Comand Line Interface (via either SSH or Telnet) as a user (usually root) the NAS creates a ptty ash shell for you and drops you into that users "home" directory as defined in the file "/etc/passwd". If the home directory contains a file ".profile" (synology use one for the user "root" it is "/root/.profile") this is read and actioned setting environment variables, such as path, alias's, prompt etc. You can add to this file to run scripts or set parameters when you log in using the CLI.

Revision as of 19:46, 22 May 2008

What is this page about

This page is intended to pull together lots of bits of information on just how Synology have implemented linux on their NASs. This needs to be a factual resource, it is NOT a document to discuss the pros or cons of the way Synology have implemented Linux.

If you are adding information to this page please always state the model and firmware version for which you are commenting as some of the information is likely to vary from model to model and firmware to firmware.

If you are unsure but have a hunch at how something works then also please state it making it clear that you don't know for certain by stating 'I think'..... If you as a reader know for sure then please remove the 'I think's.

Bootup

For CS407 fw598 'I think' the system reads;

  1. File "/etc/defaults/rc.conf" to set initial parameters and the path to find other startup scripts which is set as... local_startup="/etc/rc.d /usr/syno/etc/rc.d /usr/local/etc/rc.d"
  2. So the script "/etc/rc" is run. It does many things including a check for (and then execute if it exists) the file "etc/rc.local" which 'I think' is an ipkg installed script.

How is PATH set

For CS407 fw597 'I think' this is first set by "/etc/rc" then by "etc/rc.local" (if you have ipkg) then by the ".profile" file in the users HOME directory (i.e. "/root/.profile" for user root).

What happens when you log in to the Command Line Interface

For CS407 fw598 when you log in to the Comand Line Interface (via either SSH or Telnet) as a user (usually root) the NAS creates a ptty ash shell for you and drops you into that users "home" directory as defined in the file "/etc/passwd". If the home directory contains a file ".profile" (synology use one for the user "root" it is "/root/.profile") this is read and actioned setting environment variables, such as path, alias's, prompt etc. You can add to this file to run scripts or set parameters when you log in using the CLI.