~$ cat /etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/dev/xvda2 /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
/dev/xvda3 none swap sw,comment=cloudconfig 0 0
/dev/xvdf /home/ubuntu/apps auto defaults,nobootwait,comment=cloudconfig 0 0
我将应用程序存储到 EBS 磁盘(EC2)中,发生的情况如下:
[8478660.968721] init: Failed to spawn rails main process: unable to change working directory: No such file or directory
[8478661.020311] init: failsafe main process (540) killed by TERM signal
[8478661.129133] kjournald starting. Commit interval 5 seconds
[8478661.137579] EXT3-fs (xvda2): using internal journal
[8478661.137587] EXT3-fs (xvda2): mounted filesystem with ordered data mode
[8478661.375571] Adding 917500k swap on /dev/xvda3. Priority:-1 extents:1 across:917500k SS
[8478661.588418] EXT4-fs (xvdf): mounted filesystem with ordered data mode. Opts: (null)
看起来应用程序正在尝试在最后一个文件系统挂载之前启动,新贵脚本位:
start on filesystem and started networking
...
chdir /home/ubuntu/apps/rails/current
chdir 立即失败,因为文件系统尚未挂载。
我还尝试了其他事件(指定 INET 等),但networking
无济于事。
我正在使用 Ubuntu 12.04。
答案1
检查 /etc/fstab 解决了该问题。
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/dev/xvda2 /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
/dev/xvda3 none swap sw,comment=cloudconfig 0 0
/dev/xvdf /home/ubuntu/apps auto defaults,comment=apps 0 1