Ubuntu how to add a program to autoload. Creating your own autorun script at computer startup.

After starting the computer, as a rule, we have to run some programs. which we use most often. Also, after starting the system, we may need to perform some specific actions, for example, create the necessary files or set some parameters. It is very inconvenient to do this manually. To solve such problems, there is a startup.

Select a program and click "More Information" to get additional information. Just install the program by clicking “Install” and enter the administrator password. Installations always require administrator rights. Managing Existing Programs: Center software  - This is not just a download center for new installations. If you click “Installed” on the function panel, you will be presented with an overview of existing software. You can mark backup or redundant programs and delete them using the “Delete” button.

In this article, we will look at how Linux autoload works, how to add autoload programs, where it will be more correctly added, and what types of autoload in this operating system.

To understand how autoload works, you first need to remember what happens during. As soon as the kernel completes its initialization and is ready for further work, it will transfer control to the initialization system. The initialization system is the main process, it is he who starts all the other processes in the system.

Caution when uninstalling: when uninstalling software, you should always be bright. The packages displayed after this are dependent components. If you are not sure that you still need this software, you must complete the “Cancel”.

Package Sources and Update Behavior. For additional package sources, go to “Edit программного Software Sources” in the Software Center. This is the same and important settings dialog that you also reach through System Preferences, Software and Update. After clicking “Close”, the system automatically updates the list of packages.

There are processes that the initialization system, for example, systemd, starts by default, but you can also configure it to start the processes you need. Also, many child processes execute script files or there is one or another opportunity to run the programs you need. Most desktop environments have this feature.

An important source that you know can be contributed to existing list  in the "Other software" section labeled "Add." You also decide whether to download them immediately or install them immediately. Manufacturers - especially for graphics cards and chips - can be installed on the Advanced Drivers tab.

When you click on this tab, the search for drivers will begin, and then all the drivers for your hardware will be displayed. Software management using the terminal. The software is installed immediately: if the package is in the sources, you will get a list of components and information about how much space is required.

Consider the basic startup levels that you can use:

  - you can specify any program that will be launched after the kernel starts instead of the initialization system;  - launch of basic system services, additional services, as well as your scripts at the initialization stage of the system;  - An outdated method for loading scripts, performed before starting the graphical environment;  - you can execute your scripts or commands after starting the login manager, but before starting the environment;  - launch necessary programs  or scripts immediately after starting the X server;  - Most environments support startup programs, you can even configure delayed start and other parameters;  - the most recent option is autoload at the individual command shell, you can execute the necessary commands automatically as soon as the terminal is launched.

Autoloading at the kernel level is unlikely to be very useful for everyday use, but I decided to mention it, since there is such an opportunity. Using the init kernel parameter, you can specify which program should be run immediately after kernel initialization is complete. For example, you can load the Bash shell instead of Systemd. To do this, just tweak the kernel launch line in the Grub configuration file or during startup. Add the init parameter to the end:

De-install the program. To clean unnecessary packages, use. Click on it, ask to open a dialog with which this link should open. A click opens it and offers installation. A second or secondary computer is never displayed, so matching is not possible. We hope that the upcoming version 04 will remove this error again. This allows everyone to use most of the improvements and applets of the dock.

If you are having problems, you can understand how easy it is to customize your favorite docking station to suit your needs. The following is an incomplete list. Runlevel 6: Reboot - Restarts the system. Distribution is widespread and well-documented.

sudo vi /boot/grub2/grub.cfg

linux /vmlinuz-4.8.0-22-generic root \u003d / dev / mapper / systems-ubuntu ro quiet init \u003d / bin / bash


But, usually, it’s more convenient to change this value temporarily, in grub menu. Read more about this in the article. This does not autoload linux programsbut, nevertheless, it can sometimes be useful.

You can always benefit from your experience by searching the Internet if you have problems with your own settings. This is one that contains a compressed and read-only file system. In terms of programs such as package manager or file managerIt looks like the file system will be writable. However, after restarting the live system, all changes disappeared. Section In the simplest case, add only new software packages and remove unnecessary ones.

Select the desired file in the “Source Image File” section. Finally, click Create Bootable Media. There are several ways to run programs, depending on where the program is located. This is how you run programs in the current directory differently from programs installed on the system that have security aspects as the background.

Most often, when it says Linux autoload, it means the autoload of services using the initialization system. Systemd has a very advanced system. It supports dependency resolution, parallel start, delayed start, and restart if an error occurs. In Systemd terminology, all launched programs are represented by unit files, each unit describes the program parameters, its executable file, as well as additional launch requirements.

If you want to separate the program from the terminal, you have two options. Here the program is removed from the list of tasks and continues to work when the terminal is closed. Other programs are launched by entering the full path and file name. Again and again they asked: the beginning of programs that are not from official sources of packages. The easiest way is to use the command on the command line.

Automated installation via script

Another possibility is to start over. This review also allows you to configure and delete any installed application. To install the game using an existing script, proceed as follows. Go to the "Installation" section and go to the next dialog.

The systemctl command is used to add or remove services from autorun. To add a service to autorun, do:

sudo systemctl enable service_name

And to disable its linux autorun:

sudo systemctl disable service_name

For example, if you want to add Apache to autoload, then you need to do:

sudo systemctl enable apache

You can also check if the service has already been added to startup:

Here you select the category, and then the right side of the script. For some scripts, a description of the program or installation is displayed at the bottom of the window. In the last dialog box, you must select the path to the installation tool. Follow the steps below. However, in step 4, click "Modify or update an existing application."

Here you select the application you want to install and click "Next". In the next dialog box, you do not select a point and do not confirm it by clicking “Next”. The following is a dialog box for selecting a file to run. Browse and select a patch. On "Next" and the update process will begin.

sudo systemctl is-enabled httpd


If you don’t know the exact name of the service file, but you know its first letter, then you can use auto-completion, as in any other place of the terminal using the Tab button:


Then you get to a dialog box asking if you want to create a shortcut. Since you have a program that has been fixed, one is here on “No.” Click the program you want to uninstall and click “Uninstall” on the toolbar. This is followed by the delete dialog. Follow the onscreen instructions.

There are many options, including. After setting, click “Cancel”. From the Tools menu, select Manage Wine Versions in the following dialog box. The selection of versions that can be installed through an external source is constantly expanding and can be viewed using the following command.

You can also see all the services that have been added to startup using the command:

systemctl list-unit-files | grep enabled


Previously, it was customary to place all scripts that are run by default in the /etc/rc.local file. This file still exists, but it is a relic of the SysVinit initialization system and is now saved for compatibility only. Scripts need to be loaded only with the help of Systemd.

But if you want to create your own software server or run the program in the terminal, you need to do it yourself. Thank you for understanding. In addition, there are several introductory videos. A new collection can be created using the icon in the upper left corner. This is a separate folder in which entries can be sorted by project or topic. Additional subfolders may be created for the collection.

Entries in collections are aliases, not duplicates. Entries can be supplemented by notes, files and links. Related records are displayed in the middle column below the main record. Use the arrow next to the main entry to hide or show it.

To do this, just create a simple unit file and add it to startup, like any other service. First, create this file:

sudo vi /lib/systemd/system/runscript.service


  Description \u003d My Script Service
  After \u003d multi-user.target


  Type \u003d idle
  ExecStart \u003d / usr / bin / local / script.sh


  WantedBy \u003d multi-user.target

In section Unit  we give a brief description of our file and speak using the option Afterthat you need to run this script in multi-user mode (multi-user). Section Service  the most important, here we indicate the type of service -   idle, this means that you just need to start and forget, there is no need to conduct observation, and then in the parameter Execstart  specify the full path to our script.

Single or multiple gear

This defines rudimentary metadata that you can add manually.

Adding entries via ID

After selecting the desired document type, metadata can be entered in the right column. This means that particularly well-proven sources can be recorded. The software center now displays the available programs in alphabetical order, which you can remove. If you find that the selection is too extensive, then limit the list here to the search field in the upper right corner.

It remains to set the correct rights:

sudo chmod 644 /lib/systemd/system/runscript.service

Then update the configuration and add to startup Linux new  script:

sudo systemctl daemon-reload
  $ sudo systemctl enable myscript.service

After the next reboot, this script will be launched automatically. Please note that for each script that you intend to run, the rights must be set correctly, namely, you need to set the execution flag. To do this, use the chmod command:

A new story feature can also help you delete. If you select this item, the software center sorts the available programs according to the installation date, update, or date of removal. These are archives containing libraries, configuration files, and executable programs. During installation, the software center distributes files to the right places  at file system. Software Center does not display dependencies during installation.

If the program center is missing a program, add additional source packages to use, for example, some video codecs or completely new versions of software. Figure 3: Adding additional software sources or restricting choices.

sudo chmod u + x / usr / local / bin / script

In the parameters, we pass the script file address to the utility. Feasibility is a must for all methods.

Often, in light desktop environments and window managers, startup programs at the X server level are used to autoload programs. All scripts launched in this way will start after starting the X server. To set up such a Linux startup, all you have to do is add the path to the script you need in the ~ / .xinitrc or / etc / X11 / xinit / xinitrc file. The syntax for the added string is as follows:

To set up an additional repository, go to the Other Software tab. A popular alternative is also. The tool overwrites the volume without warning. An active internet connection is recommended.

First of all, you need to find out if your system is protected boot enabled. In short, the system checks to see if the bootloader is digitally signed. Only then can you run operating system. How do you get from manufacturer to manufacturer.

The process cannot be described as a whole because different manufacturers  use different designs. We will illustrate this topic using our sample calculator. In the root directory you can navigate there. If you select this file, the system will request a name for the entry in the database. If the latter is installed, you must import the key.

exec script_path &

If the ~ / .xinitrc file does not exist yet, then you need to create it:

cp / etc / X11 / xinit / xinitrc ~ / .xinitrc

Then, to add to startup linux scriptedit the file as you need. For example, we will start Firefox:

exec / usr / bin / firefox &





First, you will be presented with the appropriate screen. Please note that in the live version, the language can be changed to German, but this does not apply to the keyboard. It also has an English layout. They cost less than ten euros and are guaranteed to work. The installation wizard will open and you will need to follow the instructions. We will discuss here only the important points.

On the second screen, the system asks if you want to download updates during installation. However, depending on the speed of the Internet, the installation takes longer. You can also specify whether third-party software should be installed. These are codecs, drivers, etc. Which are partly property. It’s more convenient to put this hook.

Powerful desktop environments like Gnome and KDE have their own startup applications. For example, in Gnome, a program is called   "Autostarted applications". You can start it from the main menu of the system:


Here you see all the programs that are already added to startup. You can disable each of them simply by unchecking.

Separation hard drive  is the next step. Possible parameters are, for example, the use of the entire hard disk, which, of course, will be deleted in this case. If you decide to do this, do not forget to enter the password in the next step, which must be entered at each start. However, do not lose this password, otherwise the data will be lost. The rest of the installation is self-explanatory. You define the time zone, keyboard layout, configure account user etc. when you create a user account, you can specify how to encrypt personal data.


To add new program  or script to autoload click "Add":


Here you need to fill in three fields:

  • Name  - an arbitrary name for the team by which you can find it;
  • Team  - The full path to the executable file of the program;


Softovick

But only your home directory is encrypted, not the entire system. Now just relax and wait for the installation to complete. After that, you can try to conduct a session in real time or restart the system.


Then click the Languages \u200b\u200bicon. Now the system checks the language support and indicates that it is not fully installed. You can do it here.

If the system asks for a password, it depends on your user. This component is now looking for proprietary drivers available for your system. They can be installed here very in a simple way.


You will find the symbol in the sidebar. The software center is divided into categories that will help you quickly understand. Alternatively, you can enter a term at the top to search for programs. Package management gives you access to several thousand packages. Installation is simple and is done over the Internet through a so-called repository.

Inspired by the article, I decided to develop the theme a bit and configure the Domino server autoload at system startup.
  I’ll not think up anything new, because I’ll just describe briefly what needs to be done so that the Lotus Domino server starts automatically when the system boots up in a screen session. So, let's begin:
  1 step: we will make a startup script, as in the subject;
   sudo nano /etc/init.d/autostart.script
  Step 2: insert the following lines into it
   #! / bin / bash
  screen -A -m -d -S domino su - notes -c "cd ~ && / opt / ibm / lotus / bin / server"
  This script will start the screen session from the root called “domino”, log in as the user “notes” and start the server.
  Step 3: make the script file executable and add it to startup

  Voila, as the French say.
  As a result, we get a situation in which, when the system boots, the server will automatically start. The screen session will then be launched on behalf of the root, so to see the result of the launch (there will be a server console), you should type the command sudo screen -r
  P.S .: if someone tells me how to start the screen session correctly on behalf of a local user, I will be grateful.
Ext. 08.09.2009 r.
As a result of trial operation, it was possible to identify that this method works fine in Ubuntu, but does not work in OpenSUSE 10. First of all, due to the lack of update-rc utility, and secondly because of a slightly different startup mechanism. So, if anyone needs to do a startup of the Domino server in OpenSUSE, then for you step number 3 will look like this: su
  chmod + x /etc/init.d/autostart.script
  ln -s /etc/init.d/autostart.script /etc/init.d/rc5.d/S95autostart.script/etc/init.d/.
  The first line of the file should indicate which shell or interpreter will execute commands in the file. If you want to use the same commands as in the terminal, then the file should begin with the line:

   #! / bin / bash

2. You need to allow the file to run:

Sudo chmod + x /etc/init.d/autostart.script

3. We tell the system that this file must be executed at system startup:

Sudo update-rc.d autostart.script defaults 95

Where 95 is the order in the execution queue. Learn more from

Man update-rc.d

We restart the system and enjoy the result 🙂

P.S.
  To remove from the auto start you need to do:

Sudo update-rc.d autostart.script remove