Znam da radi sa sudo i meni je bilo nejsno zasto sa gksudo se ponasa kao root. Ali sad znam.
A revo i zasto (izvod iz man gksu):
This manual page documents briefly gksu and gksudo
gksu is a frontend to su and gksudo is a frontend to sudo. Their pri‐
mary purpose is to run graphical commands that need root without the
need to run an X terminal emulator and using su directly.
Notice that all the magic is done by the underlying library, libgksu.
!!! Also notice that the library will decide if it should use su or sudo as !!!
backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu
command. You can force the backend by using the gksudo command, or by
using the --sudo-mode and --su-mode options.
If no command is given, the gksu program will display a small window
that allows you to type in a command to be run, and to select what user
the program should be run as. The other options are disregarded, right
now, in this mode.
Iz nekog razloga on odlucuje da pokrece kao su, a ne sudo (one ! sam ja dodao). Probao i sam i da izmenim Backup.desktop u
Exec=gksudo --preserve-env backup
da sacuva current enviroment, ali to samo delimicno resava svar jer sada Backup Settings smesta u $HOME gde treba, ali je owner root, sto je i logicno jer je folder napravo proces sa sudo privilegijama. Pokusao sam da dodam u skripti komandu
sudo chown -R $USER:$USER $HOME/Backup Settings/
posle pozivanja fukcije backup ali chown se ne snalazi u ovom slucaju sa $ varijablama, dok ista komanda kroz terminal radi. Znaci nesto ovde nije kako treba, valjda cu skontati sta mu je.
Inace install.sh je imala problem u petlji za proveravanje postojanja dselect paketa, pa sam ispravio i okacio gore novi link, a da ne bi skidao ponovo evo kao kod pa ako budes testirao samo prelepi preko stare install.sh
Code:
#!/bin/bash
#Install script
sudo echo
if [ -f /usr/bin/dselect ]
then
sudo cp ./usr/bin/backup /usr/bin/
sudo cp -r ./usr/share/applications/* /usr/share/applications/
sudo cp -r ./usr/share/icons/hicolor/192x192/apps/* /usr/share/icons/hicolor/192x192/apps/
sudo zenity --info --text “Applicaton Backup installed successfully!”
else
zenity --question --text=“You need dselect for Backup to work. Do you want to install it now?”
if [ $? == 0 ]
then
sudo apt-get install dselect | zenity --text-info --height=700 --width=450 --title “Installing dselect. Press OK when done…”
sudo cp ./usr/bin/backup /usr/bin/
sudo cp -r ./usr/share/applications/* /usr/share/applications/
sudo cp -r ./usr/share/icons/hicolor/192x192/apps/* /usr/share/icons/hicolor/192x192/apps/
fi
sudo zenity --info --text “Applicaton Backup installed successfully!”
fi
exit 0
Edit: Da zlo bude grdje i konfuznije, kad pokrenem gksu-properties vidim da kod mene gksu pokrece sudo a ne su!? O svasta. Zasto onda ne radi
sudo chown -R $USER:$USER $HOME/Backup Settings/
jos sam sa ga sa --preserve-env naterao da upamti $HOME i $USER. Ospice dobijam…