Announcement

Collapse
No announcement yet.

[Solved] Best place for a startup command?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Solved] Best place for a startup command?

    Hi,

    I have a calender synchronisation daemon that I would like to start every time I log into my account. It's started with a shell script. I have been putting some extra lines in /etc/profile but I want those to start for every user when the computer loads Linux - this I don't. I also don't want to add the shell script to the ~/kde/Autostart directory. Can anyone recommend which file to append to run the shell script on each login? Thanks!

    #2
    Re: Best place for a startup command?

    Put it in /etc/skel - every time you set up a new user /etc/skel serves as the basis of what gets put into his/her home directory.
    Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

    Comment


      #3
      Re: Best place for a startup command?

      I've read that there is an /etc/xdg/autostart directory. I have never played with anything there, so no guarantees.

      Comment


        #4
        Re: Best place for a startup command?

        Ok thanks but is there a file I can add a line to in my existing kde profile? I just want to add:

        'sh /usr/local/sbin/GCALdaemon/bin/standalone-start.sh'

        Thanks

        Comment


          #5
          Re: Best place for a startup command?

          Personally, I would put such a script in my ~/.kde/Autostart/ directory, if I never wanted to log in to Gnome. However, another alternative would be to put the line in ~/.bashrc file.

          Comment


            #6
            Re: Best place for a startup command?

            Originally posted by askrieger
            Personally, I would put such a script in my ~/.kde/Autostart/ directory, if I never wanted to log in to Gnome. ...
            I agree. This is exactly where I put my first time login stuff. I have a small relic of my old .xinitrc script in there as an executable shell script named "xinitrc":

            Code:
            #!/bin/sh
            xrdb -DHOME=$HOME $X/Xresources
            xset +fp $X/fonts/pcf/,$X/fonts/snf/
            xmodmap -e 'clear Lock' -e 'add control = Caps_Lock'
            Obviously some of this can be handled via new mechanisms in KDE4 but it serves to point out some of the things you can do. For instance, the environment variable $X comes from my .bashrc ...

            Casey

            Comment


              #7
              Re: Best place for a startup command?

              Oh, I thought you had already done it for yourself and other users - of course the ~/.kde/Autostart folder is the right choice for retrospective addition. The /etc/skel works for new users only...
              Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

              Comment


                #8
                Re: Best place for a startup command?

                Ok thanks for the replies guys,

                I'm going to put it in the Autostart folder after all I tried creating a new .bash_profile file so that it would run upon log in. One visit to the root console later... it didn't work that well! So should I just create a new bash script that looks like:

                #!/bin/sh
                sh /usr/local/sbin/GCALDaemon/bin/standalone_start.sh

                and place that script file in the Autostart folder?

                Thanks again

                Comment


                  #9
                  Re: Best place for a startup command?

                  Sure, or put a link to your script in the autostart folder.

                  Comment


                    #10
                    Re: Best place for a startup command?

                    Well if you want it to start up no matter what DE you choose, you can put it in ~/.config/autostart . That, I believe, is the XDG autostart directory for each user, and so KDE4, GNOME, etc should all look there as well for startup scripts.

                    Comment


                      #11
                      Re: Best place for a startup command?

                      Right. Done!

                      I was being a little slow on this one. Once I realised I definitely should use the ~/.kde/Autostart directory I really wanted to write a script to start some stuff. There was no need. Browsing the boards I noticed someone talking about an application in the system settings that configures Autostart for me. It even has a specific option for shell scripts! It then placed a symbolic link to the script I wanted, saving me the time trying to remember how to create a symbolic link myself. AWESOME. Thanks everyone for the help

                      Comment


                        #12
                        Re: Best place for a startup command?

                        Originally posted by NumericalMethods
                        ...an application in the system settings that configures Autostart...
                        For the benefit of those wondering:

                        K Menu > System Settings > Advanced > Autostart
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Re: [Solved] Best place for a startup command?

                          And also just for the record, you can easily make a link by Alt-dragging in Dolphin from your shell script to the Autostart directory (or wherever you want your symlink to show up).

                          Comment

                          Working...
                          X