Hadyai Internet R&D LAB
ผลงานของ Hadyai Internet R&D LAB => คุยกับทีมวิจัย => ข้อความที่เริ่มโดย: admin ที่ 02 สิงหาคม 2010, 05:42:17
-
สำหรับผู้ที่ทำแผ่นติดตั้ง หรือทำสคริปตอนบูต แล้วเจอปัญหาว่า Ubuntu 9.10 เป็นต้นไป
ไม่สามารถแสดงผลข้อความจากสคริปที่เขียนไว้ได้ เช่น เขียนไว้ใน rc.local เป็นต้น เพื่อแสดงผลหรือแสดงค่าต่าง ๆ
วิธีทำก็คือ ให้ส่งข้อความไปแสดงที่ /dev/console แทน ยกตัวอย่างเช่น ไฟล์ /etc/rc.local
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "Hello This is rc.local message" > /dev/console
exit 0
เพียงเท่านี้ก็จะสามารถแสดงผลข้อความให้เห็นในขณะที่บูตได้ครับ
(http://www.hadyaiinternet.com/images/rclocal.jpg)
ลองนำไปศึกษาปรับแต่งเพิ่มเติมกันดูนะครับ