خرید بک لینک

Hi,
I have a strange problem with a script that creates firefox profiles via command line. I can create a single profile for the sudo user while I caot create the profiles for the other normal and sudo users. I read here https://developer.mozilla.org/en-US/...d_Line_Options that the correct syntax is the following firefox -CreateProfile "JoelUser c:inteetjoelusers-moz-profile". I found on the web a command that retrieves all the user in a system. Then I added a loop over the users and the previous command.

Code:

usersList=$(getent passwd | grep -vE '(nologin|false)$' | 
awk -F: -v min=`awk '/^UID_MIN/ {print $2}' /etc/login.defs` 
-v max=`awk '/^UID_MAX/ {print $2}' /etc/login.defs` 
'{if(($3 >= min)&&($3 <= max)) print $1}' | 
sort -u)

for systemUser in $usersList; do
    echo $systemUser

    firefoxProfile="/home/$systemUser/.mozilla/firefox"
    firefox -CreateProfile "profile $firefoxProfile/m4v6pi7q.profile"
    chown -R $systemUser:$systemUser "/home/$systemUser/.mozilla/"
    
done
The problem is that if I have four-five users, the command works only for the current user that executes the script with sudo privilegios and for the first user in the list.
This is the output

Code:

admin sudo user
sudo ./user.sh 
foo

(process:19288): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Success: created profile 'profile /home/foo/.mozilla/firefox/m4v6pi7q.profile' at '/home/foo/.mozilla/firefox/m4v6pi7q.profile/prefs.js'
admin

(process:19297): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Success: created profile 'profile /home/admin/.mozilla/firefox/m4v6pi7q.profile' at '/home/admin/.mozilla/firefox/m4v6pi7q.profile/prefs.js'
jack

(process:19306): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Success: created profile 'profile /home/jack/.mozilla/firefox/m4v6pi7q.profile' at '/home/admin/.mozilla/firefox/m4v6pi7q.profile/prefs.js'
chown: caot access ‘/home/jack/.mozilla/’: No such file or directory
zorro

(process:19315): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Success: created profile 'profile /home/zorro/.mozilla/firefox/m4v6pi7q.profile' at '/home/admin/.mozilla/firefox/m4v6pi7q.profile/prefs.js'
chown: caot access ‘/home/zorro/.mozilla/’: No such file or directory
Why for the first two users is the directory for profile corretly set, while for the other is the directory of the user that executes the script /home/admin/.mozilla/firefox/m4v6pi7q.profile?
I caot understand if it is my fault or something else...thank you

- - , .

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 10 اسفند 1394 ساعت: 0:59

صفحه بندی