Linux2019. 4. 25. 10:25

wifi와는 달리 10/100/1000 정도의 선택지 밖에 없는 듯

 

 

# ethtool -s eth0 speed 10 duplex half autoneg off

[링크 : https://www.shellhacks.com/change-speed-duplex-ethernet-card-linux/]

'Linux' 카테고리의 다른 글

diff: memory exhausted  (0) 2019.06.18
plymouth  (0) 2019.06.14
ip별 대역폭 제한하기  (0) 2019.04.25
systemctl restart 시그널  (0) 2019.04.23
ata1 comreset failed (errno=-16)  (0) 2019.04.19
Posted by 구차니
Linux2019. 4. 25. 10:15

iptables나 tc를 이용하여 특정 ip에 대해 대역폭 제한을 걸 수 있는 듯

(DDoS 등에 대한 대처도 가능할 듯)

 

 

 

[링크 : https://serverfault.com/questions/191560/how-can-i-do-traffic-shaping-in-linux-by-ip]

[링크 : https://making.pusher.com/per-ip-rate-limiting-with-iptables/]

 

+

[링크 : http://man7.org/linux/man-pages/man8/tc.8.html]

'Linux' 카테고리의 다른 글

plymouth  (0) 2019.06.14
linux 링크속도 줄이기  (0) 2019.04.25
systemctl restart 시그널  (0) 2019.04.23
ata1 comreset failed (errno=-16)  (0) 2019.04.19
crontab 실행 시간 조절하기  (0) 2019.04.18
Posted by 구차니
Linux2019. 4. 23. 13:29

service나 systemctl 을 통해 restart하는거야..

걍 stop + start 하면 되는데 reload는 어떻게 구현되나 궁금해서 검색중

흐음.. 몇개 찾아보는데 SIGHUP을 보내는건가?

 

ExecReload=
Commands to execute to trigger a configuration reload in the service. This argument takes multiple command lines, following the same scheme as described for ExecStart= above. Use of this setting is optional. Specifier and environment variable substitution is supported here following the same scheme as for ExecStart=.

One additional, special environment variable is set: if known, $MAINPID is set to the main process of the daemon, and may be used for command lines like the following:

/bin/kill -HUP $MAINPID
Note however that reloading a daemon by sending a signal (as with the example line above) is usually not a good choice, because this is an asynchronous operation and hence not suitable to order reloads of multiple services against each other. It is strongly recommended to set ExecReload= to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete.

ExecStop=
Commands to execute to stop the service started via ExecStart=. This argument takes multiple command lines, following the same scheme as described for ExecStart= above. Use of this setting is optional. After the commands configured in this option are run, it is implied that the service is stopped, and any processes remaining for it are terminated according to the KillMode= setting (see systemd.kill(5)). If this option is not specified, the process is terminated by sending the signal specified in KillSignal= when service stop is requested. Specifier and environment variable substitution is supported (including $MAINPID, see above).

Note that it is usually not sufficient to specify a command for this setting that only asks the service to terminate (for example, by queuing some form of termination signal for it), but does not wait for it to do so. Since the remaining processes of the services are killed according to KillMode= and KillSignal= as described above immediately after the command exited, this may not result in a clean stop. The specified command should hence be a synchronous operation, not an asynchronous one.

Note that the commands specified in ExecStop= are only executed when the service started successfully first. They are not invoked if the service was never started at all, or in case its start-up failed, for example because any of the commands specified in ExecStart=, ExecStartPre= or ExecStartPost= failed (and weren't prefixed with "-", see above) or timed out. Use ExecStopPost= to invoke commands when a service failed to start up correctly and is shut down again. Also note that the stop operation is always performed if the service started successfully, even if the processes in the service terminated on their own or were killed. The stop commands must be prepared to deal with that case. $MAINPID will be unset if systemd knows that the main process exited by the time the stop commands are called.

Service restart requests are implemented as stop operations followed by start operations. This means that ExecStop= and ExecStopPost= are executed during a service restart operation.

It is recommended to use this setting for commands that communicate with the service requesting clean termination. For post-mortem clean-up steps use ExecStopPost= instead.

[링크 : https://www.freedesktop.org/software/systemd/man/systemd.service.html]

[링크 : https://serverfault.com/questions/767360/how-to-configure-systemd-to-kill-and-restart-a-daemon-on-reload]

 

+

$ systemctl cat nginx | grep ExecReload= 
Or by running: 

$ systemctl show nginx.service --property=ExecReload 
On my system, I get: 

ExecReload=/usr/bin/kill -HUP $MAINPID

[링크 : https://superuser.com/questions/710986/how-to-reload-nginx-systemctl-or-nginx-s]

'Linux' 카테고리의 다른 글

linux 링크속도 줄이기  (0) 2019.04.25
ip별 대역폭 제한하기  (0) 2019.04.25
ata1 comreset failed (errno=-16)  (0) 2019.04.19
crontab 실행 시간 조절하기  (0) 2019.04.18
디렉토리내 중복 파일 확인하기  (0) 2019.04.18
Posted by 구차니
Linux2019. 4. 19. 17:36

찾아도 안나오네...

일단 다른 하드를 달아서 해결..

아마도 하드 자체가 망가져서 그런 듯?

 

(검색하다 보니 noapic 이나 ahci 설정 관련으로 인식이 안되는 것도 있었던 듯..)

'Linux' 카테고리의 다른 글

ip별 대역폭 제한하기  (0) 2019.04.25
systemctl restart 시그널  (0) 2019.04.23
crontab 실행 시간 조절하기  (0) 2019.04.18
디렉토리내 중복 파일 확인하기  (0) 2019.04.18
tar 에서 파일 삭제하기  (0) 2019.03.04
Posted by 구차니
Linux2019. 4. 18. 10:48

*/5 로 설정해서 5분 마다 실행하게 했는데

두개를 동시에 해놨더니 공유문제 생겨서 하나는 실행을 못한다고 에러가 잔뜩 쌓였다.

 

그래서 5분 주기로 실행하되, 2분 차이를 두고 해보려니

*은 0-59와 같은 의미이고

 

*/5

3-59/5

이런식으로 두개를 해두면

하나는 정각부터 시작해서 5분 간격

다른 하나는 3분 부터 시작해서 5분 간격으로 된다고 한다.

일단은 걸어놨으니 기다려 봐야 할 듯

[링크 : https://stackoverflow.com/questions/12786410/run-cron-job-every-n-minutes-plus-offset]

'Linux' 카테고리의 다른 글

systemctl restart 시그널  (0) 2019.04.23
ata1 comreset failed (errno=-16)  (0) 2019.04.19
디렉토리내 중복 파일 확인하기  (0) 2019.04.18
tar 에서 파일 삭제하기  (0) 2019.03.04
sparse file 확인하기  (0) 2019.02.25
Posted by 구차니
Linux2019. 4. 18. 10:24

$ sudo yum install fdupes

 

결과 자체는 별건 없고

같은 파일들 끼리 묶어서 출력해준다.

 

[링크 : https://itsfoss.com/find-duplicate-files-linux/]

'Linux' 카테고리의 다른 글

ata1 comreset failed (errno=-16)  (0) 2019.04.19
crontab 실행 시간 조절하기  (0) 2019.04.18
tar 에서 파일 삭제하기  (0) 2019.03.04
sparse file 확인하기  (0) 2019.02.25
cron 실행 및 시간 관련 문제  (0) 2019.02.24
Posted by 구차니
Linux/centos2019. 3. 20. 10:59

언제나 그렇듯 selinux는 만악의 근원이구만?


80번 포트가 아닌 다른 포트를 쓰려고 할때 httpd 데몬이 실행안되는 경우

(아래는 5000번 포트를 웹 서버로 쓰려고 할 경우)

# semanage port -m -t http_port_t -p tcp  5000

# semanage port -a -t http_port_t -p tcp  5000

[링크 : http://egloos.zum.com/dochi575/v/4867779]

[링크 : https://stackoverflow.com/questions/17079670/]


php 페이지가 열리지 않을 경우

# ls -Z

# sudo chcon -t httpd_sys_content_t /var/www/html -R

[링크 : https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/]


'Linux > centos' 카테고리의 다른 글

리눅스 로그인 실패 로그  (2) 2019.07.07
centos7 USB 설치 중 /dev/root dose not exist 에러  (0) 2019.07.02
'abrt-cli status' timed out  (0) 2019.03.01
centos nfs client  (0) 2019.02.27
centos timezone 변경  (2) 2019.02.23
Posted by 구차니
Linux2019. 3. 4. 15:45

설마 없겠냐 했는데 다행히도 있네


$ tar --list --file=collection.tar

blues

folk

jazz

rock

$ tar --delete --file=collection.tar blues

$ tar --list --file=collection.tar

folk

jazz

rock 

[링크 : https://unix.stackexchange.com/questions/68732/remove-files-from-tar-archive]

[링크 : https://www.gnu.org/software/tar/manual/html_node/delete.html]



+

sparse 파일을 건드렸더니

tar: 다음 헤더로 건너 뜀

tar: 아카이브에서 비헤더 부분을 제거함 

이런 에러가 뜨더니 파일을 망가트려버렸다 -_ㅠ

'Linux' 카테고리의 다른 글

crontab 실행 시간 조절하기  (0) 2019.04.18
디렉토리내 중복 파일 확인하기  (0) 2019.04.18
sparse file 확인하기  (0) 2019.02.25
cron 실행 및 시간 관련 문제  (0) 2019.02.24
linux multi core 압축  (0) 2019.02.22
Posted by 구차니
Linux/centos2019. 3. 1. 13:07

볼륨 복사한다고 했더니 가상머신이 골골대서

로그인 오래걸리더니 다음과 같은 에러를 뿜어낸다

'abrt-cli status' timed out 


일단 abrt 로그인 시에 확인하지 않도록 해서 끄는 방법이 먼저 나오네..

[링크 : https://blog.inidog.com/p/20170203182]


+

버그 리포팅 툴이라..

Automatic Bug Reporting Tool; ABRT, abrtd

[링크 : https://zetawiki.com/wiki/리눅스_ABRT]

'Linux > centos' 카테고리의 다른 글

centos7 USB 설치 중 /dev/root dose not exist 에러  (0) 2019.07.02
httpd + php + selinux..  (0) 2019.03.20
centos nfs client  (0) 2019.02.27
centos timezone 변경  (2) 2019.02.23
svn on centos  (0) 2019.02.22
Posted by 구차니
Linux/centos2019. 2. 27. 17:42

centos 에서 nfs 마운트 하려는데 에러나면

# mount -t nfs 0.0.0.0:/ temp

mount: wrong fs type, bad option, bad superblock on 0.0.0.0:/,

       missing codepage or helper program, or other error

       (for several filesystems (e.g. nfs, cifs) you might

       need a /sbin/mount.<type> helper program)


       In some cases useful info is found in syslog - try

       dmesg | tail or so. 


nfs 패키지를 깔아줘야 한다. (망할!)

# yum install nfs-utils nfs-utils-lib


[링크 : https://moongblog.tistory.com/9]

'Linux > centos' 카테고리의 다른 글

httpd + php + selinux..  (0) 2019.03.20
'abrt-cli status' timed out  (0) 2019.03.01
centos timezone 변경  (2) 2019.02.23
svn on centos  (0) 2019.02.22
smb on centos  (0) 2019.02.13
Posted by 구차니