Tag Archives: linux/unix

Su prompt when switching users: resource temporarily unavailable

I failed to connect the FTP server authentication with WinSCP today. I felt really strange. Nothing has been moved and everything was normal before.
If I su to FTP user, I keep saying “-bash:fork:Resource permanently unavailable”. If I have no further questions, I have no further questions. If I su to FTP user, I have no further questions.
[root@cls vsftpd]# su bupdate
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
^C
1, first check the disk, memory are OK
[bupdate@cls vsftpd]$ top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32141 bupdate 20 0 16296 2548 1004 R 2.3 0.1 0:00.61 top
root 20 0 19272 1576 1312 S 0.0 0.0 0:06. 43 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00. 00 kthreadd
root RT 3 0 0 0 0 S 0.0 0.0 0:01.45 migration/0
4 root 20 00 0 S 0.0 0.0 0:00.12 ksoftirqd/0
root RT 00 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00. 00 watchdog/0
7 root RT 0 0 0 0 S 0.0 0.0 0:02. 26 migration/1
root RT 8 0 00 0 0 0 S 0.0 0.0 0:00. The migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:00. 25 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 0:27. 92 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:00. 92 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00. 00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:00. 01 ksoftirqd/2

2. Use ulimit-a to get the result

(plain)
view plain
copy

    the core file size (data blocks, -c) 0 seg size (kbytes, -d) unlimited Max nice (-e) 0, the file size (blocks, -f) is unlimited Pending signals (-i) 71679 Max locked memory (in kbytes, -l) 32 Max memory size (kbytes, -m) unlimited open files (-n) 1024 Pipe size (512 bytes, the -p) 8 POSIX message the queues (bytes, – q) 819200 Max rt priority (-r) 0 stack size (10240 kbytes, -s) CPU time (seconds, -t) unlimited Max user the processes (-u) 2047 virtual memory (in kbytes, -v) unlimited file locks (-x) unlimited

     
    3, modify the/etc/security/limits. Conf

    (plain)
    view plain
    copy

    The

      * soft nproc 2047 * hard nproc 16384

      limits. Conf format:

      username | @ groupname type resource limit
      The username | @ groupname: Settings need to be restricted user name, add @ in front of the group name and user name. You can also limit all users with a wildcard *.
      Type: soft, hard and -, soft refers to the current system in effect. Hard indicates the maximum value that can be set in the system. The maximum value of soft cannot exceed the value of hard. Using – indicates that both soft and hard values are set.
      The resource:
      the core – limit the size of the kernel file
      the date – the largest data size
      fsize – maximum file size
      memlock – largest lock memory address space
      nofiles – the maximum number of open file
      RSS – maximum persistent set size
      stack – stack size
      maximum CPU – units of minutes up CPU time
      noproc – process the maximum number of
      the as – Address space limit
      maxlogins – the maximum number of logins allowed by this user
      For the lims.conf file configuration to take effect, you must ensure that the pam_lims.so file is added to the startup file.
      session required /lib/security/pam_limits. So.
      session required /lib/security/pam_limits
       
      4. Or modify the /etc/profile file
      Ulimit [- acdfHlmnpsStvw] [size]
      Parameter details:

      -a>
      size: Sets the maximum value of the core file.
      -c size: Sets the maximum value of the core file. Blocks
      -d Size: Sets the maximum number of blocks in the data segment.
      -f size: Set the maximum value of the file to create. Blocks
      -l Size: Sets the maximum number of processes locked in memory.
      -m Size: Sets the maximum amount of resident memory that can be used. Kbytes
      -n Size: Sets the maximum number of file descriptors that the kernel can open at the same time. N
      -p Size: Sets the maximum value of the pipeline buffer.
      -s size: Sets the maximum value of the stack.
      -t size: Set the maximum CPU usage time. Seconds
      -v size: Sets the maximum value of virtual memory. Unit: kbytes
      Add something like ulimit -f 1000 to the end of /etc/profile so that each session will take effect when logged in.

      Ps:

      Permanent change

      remove
      Limits on maximum number of processes and maximum number of files open for Linux systems:

      Vi/etc/security/limits. Conf

      # Add the following line

      * Soft noproc 11000 # soft connection

      * Hard noproc 11000 # hard connection

      * soft nofiles 4100

      * hard nofiles 4100

      Note: * represents for all users, noproc represents the maximum number of processes, nofile represents the maximum number of open files

      Refer to the address: http://blog.csdn.net/jlds123/article/details/9146865

error: aggregate value used where an integer was expected

problem description:

casts struct struct type data into unsigned long

The reason why

cannot be converted is that the structural Type (including union) is not a Scalar Type; Conversion is only possible between quantitative types. Quantitative types include arithmetic types and pointer types, and arithmetic types include integer types and floating point types.

even if it’s

struct in_addr type:

struct in_addr
 {
    in_addr_t s_addr;
};
in_addr_t 一般为 32位的unsigned int,其字节顺序为网络顺序(network byte ordered),即该无符号整数采用大端字节序。

这里即使内存中是unsigned int 类型的,也不能实际使用成unsigned int,因为整体类型不一样,c语言禁止强制转换,强制转换是'低级类型',转'高级类型';
但是可以使用指针强制将这段内存解释成unsigned int类型的数据。

即unsigned int a1 =  *(unsigned int *)&((struct in_addr) a2);


After installation, Ubuntu encountered [SDB] asking for cache data failed assembling drive cache: write through

the original address: http://blog.csdn.net/liufei_learning/article/details/8521221

when installing ubuntu12.10 64bit server, the following error occurs:

[11690.011238] [SDB] Asking for cache data failed

[11690.011248] [SDB], drive cache: write through

googel found the following solution, which is a bug in ubuntu: after uninstalling on my machine, there will be no problem, but there will be a problem when reinstalling. For a temporary solution, write a script to start up and run

sudo rmmod ums_realtek
http://askubuntu.com/questions/132100/errors-in-dmesg-test-wp-failed-assume-write-enabled


I’m having the same issue on the official 12.04 LTS relase I also believe it is causing the system to be

less responsive. According to some sources it’s harmless. (i can apparently only post 2 links)

The following thinks this is error output from an onboard card reader:

https://bbs.archlinux.org/viewtopic.php?pid=1059099

It’s confirmed to be an upstream issue in

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/987993

Run lsusb and find the offending device

nathan@Ham-Bone:~$ lsusb 

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader

在我的情况下,它是Realtek多卡阅读器,快速检查

$ dmesg | grep realtek
[    4.716068] usbcore: registered new interface driver ums-realtek
$ lsmod | grep realtek
ums_realtek            17920  0 

显示模块ums-realtek

$sudo rmmod ums_realtek

为我解决了一个可逆的问题。这是

$sudo modprobe ums_realtek

再次启用读卡器。我还没有测试它是否工作,因为我从来没有使用它
如果这不能工作,有一些其他的方法来禁用usb设备,通过解除绑定在/sys/目录

tbody> <表> <

7
了投票

道明> <

我有同样的问题在正式12.04 LTS中继,我也相信这是导致系统反应更慢。根据一些消息来源,它是无害的。(显然我只能发布2个链接)

中被确认为上游问题

https://bugs.launchpad.net/ubuntu/ +源/ linux/+错误/ 987993 nathan@Ham-Bone:~$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 002: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader

在我的情况下,它是Realtek多卡阅读器,快速检查

$ dmesg | grep realtek
[    4.716068] usbcore: registered new interface driver ums-realtek
$ lsmod | grep realtek
ums_realtek            17920  0 

显示模块ums-realtek

$sudo rmmod ums_realtek

为我解决了一个可逆的问题。这是

$sudo modprobe ums_realtek

再次启用读卡器。我还没有测试它是否工作,因为我从来没有使用它
如果这不能工作,有一些其他的方法来禁用usb设备,通过解除绑定在/sys/目录