• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

start and stop KDM manually from the command line

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#1
hi

howto start and stop KDM from the command line?

Code:
echo "exec startkde" > ~/.xinitrc
is alredy done, but I don't mean using startx and Ctrl+Alt+Baclspace.
I'd like to start KDM manually in background.
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#3
Nicholas said:
start with startx command,
kill X either with Ctrl+Alt+Baclspace or use logout in KMenu ;)
and RTFM please
sorry, I mean not startx, this I know.
I'd like to start and stop kde in background.

I mean like:

/usr/local/etc/rc.d/kdm start

but cannot find under freeBSD 7.1
 

gelraen

Member

Thanks: 4
Messages: 35

#4
ccc said:
sorry, I mean not startx, this I know.
I'd like to start and stop kde in background.

I mean like:

/usr/local/etc/rc.d/kde start

but cannot find under freeBSD 7.1
RTFM again. More specific - section 5.7.3.1
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#5
gelraen said:
RTFM again. More specific - section 5.7.3.1
I have read the manual before I opened this posting and you really misunderstand what I want.
The problem is, in the manual is howto start KDE automatically, that's I don't wont.
Again, I'd like to start and stop KDE manually in background.
 

gilinko

Well-Known Member

Thanks: 57
Messages: 416

#6
I think you have things a bit turned about. You can't run KDE in a background process, as it is a way to have a graphical interface instead of a console.

So to verify:

1. Do you want the "console login" view, login and then use startx to enter a graphical enviroment?

or

2. Do you want the KDM/XDM/GDM graphical login window, login and gain access to your specified xorg session(kde, gnome, xfce etc)?

It's either one or the other.

Also you can't start kde without first starting your X server so the command "startx" would then start your x-server and then kde.
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#7
gilinko said:
I think you have things a bit turned about. You can't run KDE in a background process, as it is a way to have a graphical interface instead of a console.

So to verify:

1. Do you want the "console login" view, login and then use startx to enter a graphical enviroment?

or

2. Do you want the KDM/XDM/GDM graphical login window, login and gain access to your specified xorg session(kde, gnome, xfce etc)?

It's either one or the other.

Also you can't start kde without first starting your X server so the command "startx" would then start your x-server and then kde.
I'd like to start KDM graphical login window.
On freeBSD 7.0, I can simply start using:
Code:
# /usr/local/etc/rc.d/kdm start
Updating KDM configuration
Information: reading current kdmrc /usr/local/share/config/kdm/kdmrc (from kde >= 2.2.x)
Information: current kdmrc is from kde >= 3.1 (config version 2.3)

# /usr/local/etc/rc.d/kdm stop
but on freeBSD 7.1 cannot find /usr/local/etc/rc.d/kdm.
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#9
ale said:
I'm not a kde user but first, which version are you using?
Code:
FreeBSD 7.1-RELEASE Thu Jan 1 14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
 

ale

Daemon

Thanks: 160
Messages: 1,059

#10
ccc said:
Code:
FreeBSD 7.1-RELEASE Thu Jan 1 14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
Sorry, I should have been more accurate in my question (even if you wrote on the previous post you are running 7.1).
I was asking about kde version.
 

gilinko

Well-Known Member

Thanks: 57
Messages: 416

#11
ccc said:
I'd like to start KDM graphical login window.
On freeBSD 7.0, I can simply start using:
Code:
# /usr/local/etc/rc.d/kdm start
Updating KDM configuration
Information: reading current kdmrc /usr/local/share/config/kdm/kdmrc (from kde >= 2.2.x)
Information: current kdmrc is from kde >= 3.1 (config version 2.3)

# /usr/local/etc/rc.d/kdm stop
but on freeBSD 7.1 cannot find /usr/local/etc/rc.d/kdm.
So, you want the ability to enable/disable KDM as login manager for your system with a simple script? As I'm guessing you are already logged to your system, starting KDM would be useless, and the general feel for the script name is that it changes your configuration settings more than starting stopping the KDM process.
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#12
ale said:
sorry, i should have been more accurate in my question (even if you wrote on the previous post you are running 7.1).
I was asking about kde version.
kde 3.5.10
 

caesius

Well-Known Member

Thanks: 18
Messages: 280

#13
You can start kdm manually by just running kdm. If you want kdm to start automatically on boot edit /etc/ttys and look at the last entry on the ttys (8 I think).

Change xdm to kdm and off to on and kdm will start when the computer boots
 

phoenix

Administrator
Staff member
Administrator
Moderator

Thanks: 1,124
Messages: 3,944

#15
You can use the following script to start kdm from KDE4. It's based on the gdm startup script. It's only been tested on 32-bit FreeBSD 7.1-RELEASE with latest xorg, dbus, hald, and kde 4.2.2. It works for me, but that doesn't mean it won't eat your homework, break all your dishes, and drive your car into a river. :D

Save it as /usr/local/etc/rc.d/kdm4 and add kdm4_enable="YES" to your rc.conf file.

Make sure that any lines in /etc/ttys that reference xdm, kdm, or gdm are listed as off.

Code:
#!/bin/sh

# PROVIDE: kdm
# REQUIRE: LOGIN cleanvar moused syscons dbus hald
#
# Add the following to /etc/rc.conf to start KDM 4.x at boot time:
#
# kdm4_enable="YES"
#

. /etc/rc.subr

kdm4_enable=${kdm4_enable-no}

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/kde4/bin:/usr/local/bin:/usr/local/sbin

name="kdm"
rcvar=`set_rcvar`
command="/usr/local/kde4/bin/${name}"
procname="/usr/local/kde4/bin/${name}-bin"
pidfile="/var/run/${name}.pid"
start_cmd="kdm_start"

kdm_start()
{
        echo "Starting ${name}."

        ( iter=0
        while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
                if [ ${iter} -eq 60 ]; then
                        break
                fi
                sleep 1
                iter=$(expr ${iter} + 1)
        done
        iter=0
        while ! /usr/local/bin/lshal >/dev/null 2>&1 ; do
                if [ ${iter} -eq 60 ]; then
                        break
                fi
                sleep 1
                iter=$(expr ${iter} + 1)
        done

        ${command} ${kdm_flags} ) &
}

load_rc_config ${name}
run_rc_command "$1"
Then you can start/stop it manually using /usr/local/etc/rc.d/kdm start and /usr/local/etc/rc.d/kdm stop

It can also be altered to use kdm from KDE3.

Save it as /usr/local/etc/rc.d/kdm3 and add kdm3_enable="YES" to your rc.conf file.

NOTE: Don't try to use both kdm3 and kdm4 on the same system at the same time. :)

Code:
#!/bin/sh

# PROVIDE: kdm
# REQUIRE: LOGIN cleanvar moused syscons dbus hald
#
# Add the following to /etc/rc.conf to start KDM 3.x at boot time:
#
# kdm3_enable="YES"
#

. /etc/rc.subr

kdm3_enable=${kdm3_enable-no}

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

name="kdm"
rcvar=`set_rcvar`
command="/usr/local/bin/${name}"
procname="/usr/local/bin/${name}-bin"
pidfile="/var/run/${name}.pid"
start_cmd="kdm_start"

kdm_start()
{
        echo "Starting ${name}."

        ( iter=0
        while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
                if [ ${iter} -eq 60 ]; then
                        break
                fi
                sleep 1
                iter=$(expr ${iter} + 1)
        done
        iter=0
        while ! /usr/local/bin/lshal >/dev/null 2>&1 ; do
                if [ ${iter} -eq 60 ]; then
                        break
                fi
                sleep 1
                iter=$(expr ${iter} + 1)
        done

        ${command} ${kdm_flags} ) &
}

load_rc_config ${name}
run_rc_command "$1"
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#17
hi

I tried /usr/local/etc/rc.d/kdm3 script on my freeBSd 7.2 with kde-lite-3.5.10_2 but it doesn't work
and I'm getting this message:
Code:
# ./kdm3 stop
./kdm3: WARNING: $kdm_enable is not set properly - see rc.conf(5).
I've add
Code:
kdm3_enable="YES" to /etc/rc.conf
 

phoenix

Administrator
Staff member
Administrator
Moderator

Thanks: 1,124
Messages: 3,944

#18
Note the name of the variable in the error message. Change the variable name in rc.conf to match.
 

ccc

Aspiring Daemon

Thanks: 11
Messages: 621

#20
phoenix said:
Note the name of the variable in the error message. Change the variable name in rc.conf to match.
I changed in rc.conf to:
Code:
kdm_enable="YES"
and now if I try to stop kdm then I'm getting login mask like log out.
 
Top