Vncserver On Suse 12 Enterprise

Starting the vncserver by executing vncserver :1 works as expected but what actually starts? I issued these commands but nothing I see identifies with the vncserver. I believe the server is tigervnc.
service --status-all
systemctl -a
systemctl list-unit-files
chkconfig -A
Also, how can this command: "vncserver :1", be issued at startup or turn the service on at startup?
I have tried this but the command does not execute.
-rwxr-xr-x 1 root root 379 Apr 23 17:33 /etc/init.d/after.local
cat /etc/init.d/after.local
#! /bin/sh
#
# Copyright (c) 2010 SuSE LINUX Products GmbH, Germany. All rights reserved.
#
# Author: Werner Fink, 2010
#
# /etc/init.d/after.local
#
# script with local commands to be executed from init after all scripts
# of a runlevel have been executed.
#
# Here you should add things, that should happen directly after
# runlevel has been reached.
#
./usr/bin/vncserver :1

Solved:
Made the following updates to /et/c/init/d/after.local

HOME=/root
export HOME
/usr/bin/vncserver -fg :1


Similar Content



Centos 7 Startup Script

I have a Centos 7 server which setup by previous system administrator , when this server startup , it will start some service eg. apache , mysql etc, but I could not find the startup script at /etc/rc.local /etc/rc.d/rc.local or /etc/rc.d/init.d , would advise which path will be the startup script keep ?

Thanks

Centos 6.6 /etc/init.d/rc.local Doesn't Run The Command After Restart

Hi

I am using shinx and i have on instructions to execute a command after server restart from rc.local so i do this:

Code:
nano /etc/init.d/rc.local


end i add the command there save and exit:

Code:
/usr/local/bin/searchd --config /sphinxconfig/sphinx.conf

But when i restart is not running and it was fine on Centos 6.5

Then i run it manualy from ssh and all are fine ....

Any ideas why?

Thanks

How To Run An Application After The Boot ?

Hi, i know this could seems like a "simple" question but after a lot fo try i can't seems to make it works, i am stuck on this. I am working on a sbc6000x board, linux 2.6.24, an embedded system.

I am working on a pretty nice project which when called like this run perfectly :
Code:
cd /bin
./apps

(/bin/apps don't works, it must be ./apps from the directory)

After searching a little about the startup i learned about rc.local and created it in /etc/init.d, rc.local look like this :

Code:
#!bin/sh
# /etc/rc.d/rc.local: Local system initialization script.
#

cd /bin
./apps
cd

Sadly it seems it is never called. I was thinking about maybe add cd /bin, /.apps to the end of the etc/profile but i don't know if profile can run command aside from simple scripts call.

Does anyone has an idea on why this don't work or on how i could do this ?

Install Package On Centos 7

I use Centos 7 and have just installed vsftpd to the server , I want to start vsftp service after install , when I tried the command "systemctl |grep vsftp" , it show nothing .

I use previous , all services keep at /etc/rc.d/init.d , what I need to do is /etc/rc.d/init.d/vsftpd start .

Please advise what I need to do for Centos 7 to start vsftpd ?

thanks

Question About Run Level Programs And How The OS Know What To Run

Hey guys, I am a little confused about run level programs. (concerning centos)

I know when the system boots up the orders will be

bios
MBR
GRUB
kernel
init
runlevel

to my understanding - etc/init looks at /etc/inittab
then where is the run level located?
is it /etc/rc.d/rc0.d...
/etc/rc.d/rc1.d
/etc/rc.d/rc2.d
are these run level programs?

if so, what about /etc/init.d ? doesnt that also execute run level programs?

and how does it know what to start? where does it look

thanks guys just a bit confusing where what looks for what

Systemd And Loading Init File

I recently changed from Debian 7 to 8 which now uses systemd as the default init.
I had a init file that worked fine (see below) and works fine when directly invoked
Code:
$ sudo /etc/init.d/iptables start

however fails when indirectly invoked
Code:
$ sudo service iptables start
Job for iptables.service failed. See 'systemctl status iptables.service' and 'journalctl -xn' for details.

Code:
$ systemctl status iptables.service
 iptables.service - LSB: Iptable setup
   Loaded: loaded (/etc/init.d/iptables)
   Active: failed (Result: exit-code) since Mon 2015-05-25 17:18:37 PDT; 5s ago
  Process: 4825 ExecStart=/etc/init.d/iptables start (code=exited, status=203/EXEC)

Code:
$ journalctl -xn
No journal files were found.

I don't understand the error except that it "failed" and is loaded.
I have disabled and re-enabled the service with these commands:

Code:
sudo systemctl disable iptables
sudo systemctl enable iptables

which completes successfully but did not fix the problem.


INIT file
Code:
### BEGIN INIT INFO
# Provides:          iptables
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Should-Start:      $portmap
# Should-Stop:       $portmap
# X-Start-Befo     nis
# X-Stop-After:      nis
# Default-Start:     2 
# Default-Stop:      1
# X-Interactive:     false
# Short-Description: Iptable setup
# Description:       Sets iptable rules
#                    
### END INIT INFO

ipt=/sbin/iptables

loadrules() {

if [ -e /etc/iptables_ruleset ]; then iptables-restore < /etc/iptables_ruleset && exit 0; fi

$ipt -F
$ipt -X

# Policies and Chains
$ipt -P INPUT DROP
$ipt -P FORWARD DROP
$ipt -P OUTPUT ACCEPT
$ipt -N SSH
$ipt -N WEBSERVER

$ipt -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
$ipt -A INPUT -i lo -j ACCEPT # Allow loopback

# Services
$ipt -A INPUT -p tcp -m multiport --dport 443,80 -j WEBSERVER # WEBSERVER chain 
$ipt -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j SSH # Jump to SSH chain
$ipt -A INPUT -p tcp -s 192.168.1.1/24 --dport 445 -j ACCEPT # samba

# Reject message for LAN
$ipt -A INPUT -s 192.168.1.1/24 -j REJECT

# WEBSERVER chain
$ipt -A WEBSERVER -p tcp -m multiport --dport 443,80 -m conntrack --ctstate NEW -j LOG
$ipt -A WEBSERVER -p tcp -m multiport --dport 443,80 -j ACCEPT

# SSH chain
$ipt -A SSH -p tcp --dport 22 -m recent --set --name SSH # Set SSH recent
$ipt -A SSH -p tcp --dport 22 -m recent --name SSH --update --seconds 10 --hitcount 2 --rttl -j LOG # Log if over counter
$ipt -A SSH -p tcp --dport 22 -s 192.168.1.1/24 -m recent --name SSH --update --seconds 10 --hitcount 10 --rttl -j REJECT # Reject from lan if over counter
$ipt -A SSH -p tcp --dport 22 ! -s 192.168.1.1/24 -m recent --name SSH --update --seconds 10 --hitcount 2 --rttl -j DROP # Drop if over counter
$ipt -A SSH -p tcp --dport 22 -j ACCEPT

iptables-save > /etc/iptables_ruleset
}

removerules() {
$ipt -P INPUT ACCEPT
$ipt -P FORWARD ACCEPT
$ipt -P OUTPUT ACCEPT
$ipt -F
$ipt -X
}

restartrules() {
rm /etc/iptables_ruleset
loadrules
}

case "$1" in
	start)
		loadrules
		;;
	stop)
		removerules
		;;
        restart)
                restartrules
                ;;
    	*)
        	echo "Usage: $0 start|stop|restart" >&2
        	exit 3
        	;;
esac

Edit:
Checking /var/log/daemon.log gives me this info:
Code:
May 25 19:13:29 hostname systemd[6004]: Failed at step EXEC spawning /etc/init.d/iptables: Exec format error
May 25 19:13:29 hostname systemd[1]: iptables.service: control process exited, code=exited status=203
May 25 19:13:29 hostname systemd[1]: Failed to start LSB: Iptable setup.
May 25 19:13:29 hostname systemd[1]: Unit iptables.service entered failed state.

Cannot Execute Binary File

hello everyone,
I created a script file (info.sh) in linux centos 6.
location of file is '/etc/init.d/info.sh'
content of file is:

#!/bin/sh
#To get the MAC address
ifconfig | grep HWaddr
#To get the HDD serial no.
hdparm -I /dev/sd? | grep 'Serial\ Number'
#To get the HDD size
hdparm -I /dev/sda |grep "device size"

gave the permission by: chmod 777 /etc/init.d/info.sh
but when i run this file by: /etc/init.d/info.sh
it gives an error like...
-bash: /etc/init.d/info: cannot execute binary file

what should i do?? Actually i have to run this file during boot up..

thanks in advance..

PhpVirtualBox Cannot Connect To 127.0.0.1:18083

I am using phpVirtualBox, and everything is working perfectly. Then something changes, and I get the following error:
Code:
Could not connect to host (http://127.0.0.1:18083/)

I reboot the physical machine, or execute /etc/init.d/vboxweb-service restart, and then everything works for a while.

According to http://sourceforge.net/p/phpvirtualb...onnect-to-host, there are three reasons why this will happen.
Quote:
This indicates that phpVirtualBox could not connect to the vboxwebsrv server. Either the location setting in config.php is wrong, vboxwebsrv is not running on the VirtualBox host, or SELinux is blocking access to vboxwebsrv. If you have SELinux enabled
As shown below, it is not reason 2 or 3.

Code:
[root@devserver ~]# service vboxweb-service status
Checking for VBox Web Service ...running
[root@devserver ~]# service vboxdrv status
VirtualBox kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) are loaded.
[root@devserver ~]# service vboxautostart-service status
Usage: /etc/init.d/vboxautostart-service {start|stop}
[root@devserver ~]# service  vboxballoonctrl-service status
Checking for VBox watchdog service ...not running
[root@devserver ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          permissive
Policy version:                 24
Policy from config file:        targeted
[root@devserver ~]#

Thus it must be that the location setting in config.php is wrong. config.php has the following default settings, and I left them as is.

Code:
/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
var $location = 'http://127.0.0.1:18083/';
...
// Host / ip to use for console connections
#var $consoleHost = '192.168.1.40';

According to http://sourceforge.net/p/phpvirtualb...-configuration, "If VirtualBox and phpVirtualBox are on the same physical host, you may leave the $location setting alone". VirtualBox and phpVirtualBox are definitely on the same physical machine.

Please provide recommendations.

Can Not Connect Ftp Server

I have installed vsftp to the server , the status is running now , but when use the command "ftp localhost" , it pops the "421 Service not available." , would advise what is wrong ? thanks

bash-3.2# /etc/rc.d/init.d/vsftpd status
vsftpd (pid 580) is running...
bash-3.2# ps -ef |grep vsftpd
root 580 1 0 15:44 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 607 467 0 15:45 pts/0 00:00:00 grep vsftpd
bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.

?? How To Auto Mount Logical Volume Before Transmission-daemon Starts At Start Up

I have been using an old computer to download my torrents and this has been my usual routine:

1. Press the power button.
2. Connect to the computer through Putty
3. Log in
4. Gain su privileges

Startup Commands:
Code:
/etc/init.d/transmission-daemon stop
apt-get update
mount -t ext4 /dev/vgTransmission/lvTransmission /mnt/transmissionVault
/etc/init.d/transmission-daemon start

Shutdown Commands:
Code:
/etc/init.d/transmission-daemon stop
umount /dev/vgTransmission/lvTransmission
shutdown -h now

I was wondering if there is a way to configure a computer to automatically mount a logical volume “before” the transmission-daemon starts at boot up (note my first Startup Command).

I think the instructions here are related to what I want to do, but I want to get some advice before I attempt to do anything dangerous:
http://tille.garrels.be/training/tld...#sect_04_02_04


My perfect scenario would be:

Startup Routine:
1. Send WakeOnLan magic packet to computer to turn it on.
2. Computer boots up, mounts the transmissionVault logical volume
3. Wait 10 seconds to ensure that the logical volume has finished mounting
4. Start transmission-daemon

Shutdown Routine:
Send WakeOnLan magic packet to turn off computer, i.e.: Execute “shutdown -h now”
The shutdown command should include:
1. Stop transmission-daemon
2. Wait 10 seconds to ensure that transmission-daemon has finished shutting down
3. Umount transmissionVault logical volume




Recently the Ethernet port of my transmission box has stopped working, so I went ahead and swapped the motherboard with another old motherboard, added a few hard drives, installed a fresh copy of Debian, and re-created the LVM logical volume for transmissionVault. I pretty much have a fairly stock system running at the moment.

Running a headless 3.2.0-4-amd64