Linux startup process, Daemon process, and other systems: ubuntuserver12.041, linux startup process 2, SysV-style startup mode 3, runlevel running Level 0: system shutdown status, the default running level cannot be set to 0. Otherwise, the running level cannot be started properly... linux startup process, Daemon process, and other systems: ubuntu server 12.041, linux startup process 2, SysV-style startup mode 3, runlevel running Level 0: system shutdown status, the default running level of the system cannot be set to 0. Otherwise, the running level cannot be started properly. 1: the operating status of a single user, root permission, used for system maintenance. remote login to the running level is prohibited. 2: multi-User Mode Without Networking Level 3: full Multi-User Mode (with NFS). after logging on to the console, go to command line Mode Level 4: multi-user status, the system is not used, keep the running Level 5: X11 console, enter Graphical GUI mode running level 6: The system is shut down and restarted normally. the default running level cannot be set to 6; otherwise, the running level S cannot be started normally, run a few processes and services to view the current runlevel: use the command rulevel to switch the running level: init [0123456Ss]/etc/inittab: ubuntu 12.04 does not have this file. create one. Enter the running level: id: N: initdefault: after the system is started :. N is the value corresponding to runlevel. Related tools: sysv-rc-conf, update-rc.d, rcconf, chkconfig 4, ubuntu12.04 how to start to the character interface ubuntu server 12.04 after the desktop is installed, each time the default start to enter lightDM, then enter the desktop environment. The runlevel to be viewed is 2. after the inittab file is changed to 3, the system still enters the desktop. There are no LightDM files in each rcN. d file. Method 1: modify the kernel startup parameter nano/etc/default/grub modify GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash": GRUB_CMDLINE_LINUX_DEFAULT = "text" and then run the sudo update-grub2. However, in 12.04 server, the value of GRUB_CMDLINE_LINUX_DEFAULT is null (that is ""). While the update-grub2 command actually points to the update-grub command. Method 2: upstart system/etc/rcN. all files in d are/etc/init. the soft link of the file in the d Directory,/etc/init. the d directory is basically a soft connection to the/lib/init/upstart-job File (you can find time to analyze this file ), the upstart system manages all the startup items according to the configuration files in the/etc/init directory. You can modify/etc/init/lightdm. conf. In/etc/init/lightdm. conf, you can see: start on (filesystem and runlevel [! 06] and started tables and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY = 1 or stopped udev-fallback-graphics) or runlevel PREVLEVEL = S) stop on runlevel [06] changed to start on (filesystem and runlevel [! 036] and started login and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY = 1 or stopped udev-fallback-graphics) or runlevel PREVLEVEL = S) stop on runlevel [036] method 3: /etc/lightdm/users. conf (if the test fails, do not understand what hidden-users means, or the configuration file does not work). find: hidden-users = nobody nobody4 noaccess and change it: hidden-users = sunlt lotte about nobody, nobody4, noaccess: After Windows is installed, some user accounts are automatically created, in Linux, some user accounts are generated after the system is installed, just like the built-in accounts in Windows. They are used to complete specific tasks, such as nobody and ftp. we access LinuxSir. org's webpage program is a nobody user (equivalent to an anonymous account in Windows). ftp or nobody is used for anonymous ftp access. First, nobody is a common user with no privilege. The purpose of using the nobody user name is to allow anyone to log on to the system, but its UID (65534) and GID (65534) do not provide any privileges, that is, the uid and gid can only access files that can be read and written by everyone. Second, in many systems, a nobody is created by default and its permissions are limited to the minimum. when the server provides external services, the client may log on as a nobody. Nobody -- an anonymous user account, assigned by an NFS server when an unauthorized root user makes a request. the nobody user account is assigned to software processes that do not need any special permissions. noaccess -- The account assigned to a user or a process that needs access to a system through some application without actually logging into the system. nobody4 -- SunOS4.0 or 4.1 version The nobody account.5. how to create an rcN-based account. how to soft connect d daemon: bash> ln-s tree.txt treebash> ls-l... lrwxrwxrwx 1 sunlt 8 Mar 21 tree-> tree.txt-rw-r -- 1 sunlt 104946 Mar 20 tree.txt... example 1: The ubuntu system logs that record the switch-on time are generally stored in the/var/log directory. Now, create a simple log that records the switch-on time. the log file is/home/my. log. The mylog-halt file content is as follows :#! /Bin/bashecho "start">/home/my. logdate>/home/my. log file mylog-start contains the following content :#! /Bin/bashecho "halt">/home/my. logdate>/home/my. log puts mylog-start and mylog-halt into/etc/init. d/directory, add the execution permission. Manually link these two files to the corresponding rcN. d directory or use tools such as sysv-rc-conf. Example 2: a web server is a simple python-based web server example py_http.py :#! /Usr/bin/pythonfrom OS import curdir, sepfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTPServerclass MyHandler (BaseHTTPRequestHandler): def do_GET (self): content = '''Hello, kugou!'''Self. send_response (200) self. send_header ('content-type', 'text/html ') self. end_headers () self. wfile. write (content) def main (): server = HTTPServer ('', 8080), MyHandler) server. serve_forever () if _ name __= = '_ main _': main () fails to be configured according to example 1. (Continue to work...) but put python/path/to/py_http.py & into the/etc/rc. local file. Mysql startup script analysis/etc/init. d/mysql is a soft link of/lib/init/upstart-job. 6. how to create upstart-based daemon-related commands: service, initctl, update-rc.d, invoke-rc.d7, atecho touch ~ /Touch_file | at now + 2 minutes --> Create/update files in two minutes ~ /Touch_file echo shutdown-h now | at now + 4 hours --> shut down after 4 hours. 8. for crontab, view the man documents of cron and crontab commands. here, man 5 crontab gets more details than man crontab. 9. about nohup10, start the desktop program in other ways ~ /. Config/autostart directory, which is created with the name. desktop files (an executable shell script or something), similar to files in the application directory, if you want to start only in a desktop environment, you can add OnlyShowIn = to the corresponding desktop directory. ;, Such as OnlyShowIn = KDE ;. Other autostart directories:/etc/xdg/autostart/usr/share/TPD/autostart/usr/share/gnome/autostart ~ /. Config/autostart ~ /. Kde/share/autostart ~ /. Local/share/autostart other user configuration files, such as/etc/bash. bashrc ,~ /. Bashrc
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.