Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #258386

Re: How to run a command / script on startup automatically in linux?

From Joe <joe@jretrading.com>
Newsgroups linux.debian.user
Subject Re: How to run a command / script on startup automatically in linux?
Date 2023-05-15 21:40 +0200
Message-ID <GvMd3-98Be-13@gated-at.bofh.it> (permalink)
References <GvKkV-97s9-3@gated-at.bofh.it> <GvL7j-97Y8-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 15 May 2023 20:26:09 +0200
<tomas@tuxteam.de> wrote:

> On Mon, May 15, 2023 at 10:44:37PM +0530, Susmita/Rajib wrote:
> > My dear illustrious List members and leaders of the Debian-users
> > group:  
> 
> [...]
> 
> > I saved a file at "/etc/systemd/system/" named "rc-local.service"
> > with the following lines:  
> 
> [...]
> 
> > I also added the line in the file /etc/rc.local:
> > mousepad  
> 
> 
> Is it this mousepad?
> 
>   mousepad/stable 0.5.2-1 amd64
>     simple Xfce oriented text editor

That's the only one I ever heard of. I use it, mostly as a clipboard
where the usual copy/paste is having trouble, or if I want to make
alterations before pasting.
> 
> > But the program doesn't launch at startup. Where I am going wrong?
> > Does it fail to start because the command is run before the GUI
> > starts up?  
> 
> Then yes: system startup is "too early". Most probably you don't even
> want to have it running as a "system program", but as a "user
> program", under your user ID and whithin your (user) graphical
> session.
> 
> In this case, I'd look at what possibilities your desktop environment
> (or window manager) offer. They usually have a way to start programs
> at session start (at which point all the environment your mousepad
> will need is set up).

Indeed. If the OP is running Xfce, then Settings, Session and Startup in
the main menu allow applications to be started on login.

But this is the simple answer, and it may be that the OP is more
concerned with learning system autostart procedures, in which case a
GUI application like Mousepad isn't the right one to play with. Running
something like an iptables script without using iptables-persistent
might be a better choice.

-- 
Joe

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to run a command / script on startup automatically in linux? "Susmita/Rajib" <bkpsusmitaa@gmail.com> - 2023-05-15 19:40 +0200
  Re: How to run a command / script on startup automatically in linux? Greg Wooledge <greg@wooledge.org> - 2023-05-15 19:50 +0200
    Re: How to run a command / script on startup automatically in  linux? Charles Curley <charlescurley@charlescurley.com> - 2023-05-15 20:50 +0200
      Re: How to run a command / script on startup automatically in linux? Greg Wooledge <greg@wooledge.org> - 2023-05-15 21:00 +0200
        Re: How to run a command / script on startup automatically in linux? <tomas@tuxteam.de> - 2023-05-16 06:30 +0200
    Re: How to run a command / script on startup automatically in linux? Vincent Lefevre <vincent@vinc17.net> - 2023-05-15 21:40 +0200
      Re: How to run a command / script on startup automatically in linux? Greg Wooledge <greg@wooledge.org> - 2023-05-15 22:00 +0200
        Re: How to run a command / script on startup automatically in linux? Vincent Lefevre <vincent@vinc17.net> - 2023-05-15 23:10 +0200
          Editing /etc/rc.local [was: How to run a command / script on startup  automatically in linux?] <tomas@tuxteam.de> - 2023-05-16 06:40 +0200
            Re: Editing /etc/rc.local [was: How to run a command / script on  startup automatically in linux?] Vincent Lefevre <vincent@vinc17.net> - 2023-05-16 11:50 +0200
  Re: How to run a command / script on startup automatically in  linux? Charles Curley <charlescurley@charlescurley.com> - 2023-05-15 20:00 +0200
    Re: How to run a command / script on startup automatically in linux? Max Nikulin <manikulin@gmail.com> - 2023-05-16 04:40 +0200
      Re: How to run a command / script on startup automatically in linux? Max Nikulin <manikulin@gmail.com> - 2023-05-16 09:10 +0200
  Re: How to run a command / script on startup automatically in linux? Christoph Brinkhaus <c.brinkhaus@t-online.de> - 2023-05-15 20:10 +0200
  Re: How to run a command / script on startup automatically in linux? <tomas@tuxteam.de> - 2023-05-15 20:30 +0200
    Re: How to run a command / script on startup automatically in  linux? Charles Curley <charlescurley@charlescurley.com> - 2023-05-15 20:50 +0200
    Re: How to run a command / script on startup automatically in  linux? Joe <joe@jretrading.com> - 2023-05-15 21:40 +0200
  Re: How to run a command / script on startup automatically in linux? "Susmita/Rajib" <bkpsusmitaa@gmail.com> - 2023-05-16 07:50 +0200
    Re: How to run a command / script on startup automatically in linux? Vincent Lefevre <vincent@vinc17.net> - 2023-05-16 12:10 +0200
    Re: How to run a command / script on startup automatically in linux? Greg Wooledge <greg@wooledge.org> - 2023-05-16 13:20 +0200
    Re: How to run a command / script on startup automatically in linux? "Susmita/Rajib" <bkpsusmitaa@gmail.com> - 2023-05-16 14:10 +0200
      Re: How to run a command / script on startup automatically in linux? "Susmita/Rajib" <bkpsusmitaa@gmail.com> - 2023-05-18 08:10 +0200

csiph-web