第一种启动方式
sudo gedit /etc/profile
第二种
sudo gedit /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# start fastdfs
sudo /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
sudo /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
# start nginx
sudo /usr/local/nginx/sbin/nginx
exit 0
- nginx
#!/bin/bash
gnome-terminal -x bash -c '
cd /usr/local/nginx/sbin
echo 000 | sudo -S ./nginx;exit 0'
- tracker和storage
#!/bin/bash
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
- 修改权限
sudo chmod 777 xxx
or
sudo chmod 777 -R xxx
- 添加启动项
sudo gedit /etc/profile