설치해야 하는 패키지는 fortune-mod 라는 패키지입니다. 설치는 다음과 같이 한다.
[root@yarang-2nd profile.d]# yum install fortune-mod
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
core [1/3]
updates [2/3]
extras [3/3]
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package fortune-mod.i386 0:1.99.1-5.fc5 set to be updated
--> Running transaction check
--> Processing Dependency: librecode.so.0 for package: fortune-mod
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package recode.i386 0:3.6-21.fc5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
fortune-mod i386 1.99.1-5.fc5 extras 1.2 M
Installing for dependencies:
recode i386 3.6-21.fc5 extras 837 k
Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): fortune-mod-1.99.1 100% |=========================| 1.2 MB 00:05
(2/2): recode-3.6-21.fc5. 100% |=========================| 837 kB 00:06
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: recode ######################### [1/2]
Installing: fortune-mod ######################### [2/2]
Installed: fortune-mod.i386 0:1.99.1-5.fc5
Dependency Installed: recode.i386 0:3.6-21.fc5
Complete!
위의 명령으로 fortune-mod 패키지의 설치는 끝난다.Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
core [1/3]
updates [2/3]
extras [3/3]
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package fortune-mod.i386 0:1.99.1-5.fc5 set to be updated
--> Running transaction check
--> Processing Dependency: librecode.so.0 for package: fortune-mod
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package recode.i386 0:3.6-21.fc5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
fortune-mod i386 1.99.1-5.fc5 extras 1.2 M
Installing for dependencies:
recode i386 3.6-21.fc5 extras 837 k
Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): fortune-mod-1.99.1 100% |=========================| 1.2 MB 00:05
(2/2): recode-3.6-21.fc5. 100% |=========================| 837 kB 00:06
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: recode ######################### [1/2]
Installing: fortune-mod ######################### [2/2]
Installed: fortune-mod.i386 0:1.99.1-5.fc5
Dependency Installed: recode.i386 0:3.6-21.fc5
Complete!
forune-mod를 설치하면 사용자가 로그인하였을 때에 메시지를 보여주기 위해서 다음과 같이 설정해야 한다.
[root@yarang-2nd profile.d]# vi /etc/profile.d/motd.sh
이 파일의 내용을 다음과 같이 설정한다.#!/bin/sh
fortune -n 10
echo ""
echo Login time : `date`
위의 내용은 fortune을 실행하고 한줄 띄운 다음에 현재 시간을 출력하도록 하는 것이다. 파일의 내용을 위와 같이 넣은 다음에 이 파일을 실행가능하도록 하기 위해서 실행 퍼미션을 설정한다.fortune -n 10
echo ""
echo Login time : `date`
[root@yarang-2nd profile.d]# chmod +x /etc/profile.d/motd.sh
위와 같이 설정하면 사용자가 로그인하면서 이 파일이 실행된다. 다음은 실행된 예이다.[root@Raid1 ~]# ssh yarang
Last login: Sun Apr 2 14:45:30 2006 from ns.lowpan.com
================================================================
_ __ __ __
| | / /__ / /________ ____ ___ ___ / /_____
| | /| / / _ \/ / ___/ __ \/ __ `__ \/ _ \ / __/ __ \
| |/ |/ / __/ / /__/ /_/ / / / / / / __/ / /_/ /_/ /
|__/|__/\___/_/\___/\____/_/ /_/ /_/\___/ \__/\____/
____ __ __ __ ___ ____
/ _/___ / /____ _________ ___ / /_ / / / | / __ )
/ // __ \/ __/ _ \/ ___/ __ \/ _ \/ __/ / / / /| | / __ |
_/ // / / / /_/ __/ / / / / / __/ /_ / /___/ ___ |/ /_/ /
/___/_/ /_/\__/\___/_/ /_/ /_/\___/\__/ /_____/_/ |_/_____/
================================================================
- Create by Yarang 2006.2.3 -
- Admin Email : yarang at gmail.com -
(null cookie; hope that's ok)
Login time : 2006. 04. 02. (#) 14:52:10 KST
[root@yarang-2nd ~]#
Last login: Sun Apr 2 14:45:30 2006 from ns.lowpan.com
================================================================
_ __ __ __
| | / /__ / /________ ____ ___ ___ / /_____
| | /| / / _ \/ / ___/ __ \/ __ `__ \/ _ \ / __/ __ \
| |/ |/ / __/ / /__/ /_/ / / / / / / __/ / /_/ /_/ /
|__/|__/\___/_/\___/\____/_/ /_/ /_/\___/ \__/\____/
____ __ __ __ ___ ____
/ _/___ / /____ _________ ___ / /_ / / / | / __ )
/ // __ \/ __/ _ \/ ___/ __ \/ _ \/ __/ / / / /| | / __ |
_/ // / / / /_/ __/ / / / / / __/ /_ / /___/ ___ |/ /_/ /
/___/_/ /_/\__/\___/_/ /_/ /_/\___/\__/ /_____/_/ |_/_____/
================================================================
- Create by Yarang 2006.2.3 -
- Admin Email : yarang at gmail.com -
(null cookie; hope that's ok)
Login time : 2006. 04. 02. (#) 14:52:10 KST
[root@yarang-2nd ~]#


comments
comments rss (+댓글 쓰러가기)