To redirect both output and any errors to some_other_file:
php server.php 2>&1 some_other_file
The >& redirects a stream to another file descriptor (in BASH shell):
- 0 is stdin
- 1 is stdout
- 2 is stderr
Or, 2>&1 redirects 2 to 1. And then to watch that output in real time:
tail -f some_other_file
Starting at boot time: you could call the script from /etc/rc.local. Or, a more advanced solution might be to write a script in the /etc/init.d/ directory. See /etc/init.d/README for how to do that.
If you make the PHP file, server.php, executable, you can add a line to the top of the file (aka file magic/shebang/hashbang) to call it this way: server.php
instead of php server.php
. You could even remove the php extension if for some reason you want to do that. Like this:
#!/usr/bin/php
<?php
// PHP code here
Upstart is probably the way to go to make sure the service stays running. This method does not involve /etc/rc*. Upstart has five packages, all installed by default:
- Upstart init daemon and initctl utility
- upstart-logd provides the logd daemon and job definition file for logd service
- upstart-compat-sysv provides job definition files for the rc tasks and the reboot, runlevel, shutdown, and telinit tools that provide compatibility with SysVinit
- startup-tasks provides job definition files for system startup tasks
- system-services provides job definition files for tty services
The learning is very enjoyable and well worth it. Upstart has a website: http://upstart.ubuntu.com/
Other good posts: What's the difference between "Service" and "/etc/init.d/"?
OpenVpn by default looks for .conf
files not .opvn
in /etc/openvpn/
.
Change the file extension to .conf
then running the service should have no issues with finding the file and connecting
If you installed the package from apt-get, it has the ability to start automaticly.
Else, depending on the OS you are running there can be some differences is file paths, make a symlink to /etc/init.d/openvpn in the appropriate rc files.
ie. in ubuntu/debian
ln -s /etc/init.d/openvpn /etc/rc4.d/S99Openvpn
to start in runlevel 4
ln -s /etc/init.d/openvpn /etc/rc6.d/K99Openvpn
to stop on shutdown
That was All I had done to do to get my vpn's to start.
There is a file, /etc/default/openvpn
that has some auto start parameters.
It need the name of your file to be .conf
Then there is a line to add. AUTOSTART='client'
where client is the name of the file. ie. /etc/openvpn/client.conf
Best Answer
When you open a program, Unity will either pop up a new icon on the launcher(dock) and/or add an arrow to an existing icon. Each icon is not an executable; it is a .desktop file.
bamfdaemon
helps this by determining whether an arrow needs to be added to an existing icon, or a new icon be popped up, along with other behaviors dependent on application identity.