(&(objectCategory=person)(objectClass=user)(cn=*))
=> 모든 user 객체
(&(objectCategory=group)(cn=*))
=> 모든 group 객체
(|(&(objectCategory=person)(objectClass=user)(cn=*))(&(objectCategory=group)(cn=*)))
=> 모든 user 객체 또는 모든 group 객체
LDAP Base DN과 LDAP 동기화 속성이 되어있기 때문에 원하는 ou내에 있는 메일이 있는 계정만 동기화 가능.
# LDAP BASE DN
ou=<ORGANIZATION>,dc=<DOMAIN>,dc=co,dc=kr
# LDAP 동기화 속성
mail=mail,name=displayName
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
rc-local 자동 실행을 위해 enable을 시도 했더니 아래와 같은 메시지가 발생하고 'enable'이 아니라 'enable-runtime' 상태로 변경된 것을 확인 했다.
$ sudo systemctl enable rc-local
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.
$ systemctl list-unit-files | grep rc.local
rc-local.service enabled-runtime
rc-local 서비스 설정에 '[install]' 섹션 설정을 해야한다.
→ 이 내용은 따로 자세하게 확인해야겠다.
섹션 설정 후에 다시 enable하니 정상적으로 작동한다.
/usr/lib/systemd/system/rc-local.service
---------------------------------------------------------------
# 아래 내용 추가
[Install]
WantedBy=multi-user.target
---------------------------------------------------------------
$ sudo systemctl enable rc-local
Created symlink /etc/systemd/system/multi-user.target.wants/rc-local.service → /usr/lib/systemd/system/rc-local.service.
여기까지 설정한 후에도 작동하지 않는 스크립트는 해당 스크립트의 실행권한이 없는 것이다. 파일 소유자에 권한을 부여하고, su 명령어로 사용자를 지정하여 사용하도록 하자.
/etc/rc.local
---------------------------------------------------------------
su user -c "/home/user/startup.sh"
---------------------------------------------------------------
# 테스트를 위한 스크립트
/home/user/startup.sh
---------------------------------------------------------------
DATE=`date +%Y-%m-%d_%H:%M:%S`
touch /home/user/$DATE.txt
---------------------------------------------------------------
# rc.local 파일을 실행하거나, 서버를 재부팅하여 확인할 수 있다.
$ ll
합계 36056
-rw-r--r--. 1 user user 0 7월 8 11:08 2021-07-08_11:08:30.txt
-rwxrw-r--. 1 user user 60 7월 8 11:01 startup.sh