Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: zolf on January 30, 2011, 10:38:44 am

Title: Xsession: warning: unable to write to /tmp
Post by: zolf on January 30, 2011, 10:38:44 am

hello there,

i am unable to log into the zentyal 2.02. i get this error Xsession: warning: unable to write to /tmp.
basically the zentyal has crashed.please help

cheers
zolf
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on January 31, 2011, 06:58:46 am

please help
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on January 31, 2011, 11:34:14 am

df -h returns

/dev/mapper/ubuntu-root   6.5G   6.5G   0     100%      /

what is this folder used for and why did it get filled
Title: Re: Xsession: warning: unable to write to /tmp
Post by: peso7 on January 31, 2011, 10:01:00 pm
Hi zolf

I know, it doesn't help but I'm going to have the same problem. My /dev/mapper/ubuntu-root is filling up slowly. It's only a matter of time until it's full and things won't work anylonger.

To everybody: What's going on here?
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 01, 2011, 07:17:24 am

this is very bad,specially when you have the machine in production environment. so every once in a while we have to reinstall zentyal and config the machine from new. very disappointed
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 05, 2011, 07:08:25 am

somebody please help to get over this issue
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 07, 2011, 06:46:09 am

please help.

i did the following

cd /var/log

rm -rf *

and then ran df,so now my /dev/mapper/ubuntu-home has changed from 100% to 63% of used space.but i dont get the zentyal interface to login,i get the terminal window to work with only.
please help
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 09, 2011, 10:07:12 am

please helppppp
Title: Re: Xsession: warning: unable to write to /tmp
Post by: peso7 on February 09, 2011, 09:40:40 pm
Hi zolf

That
Quote
cd /var/log
rm -rf *
was probabely not a very good idea. You lost all your log files.

But I'm "a bit confused" too, that this problem occurs at all and that no Zentyal staff helps.

peso7
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 12, 2011, 07:57:02 am

yes you were correct.

it is so weird issue with Zentyal. it is like a timebomb we are sitting on. i hope somebody cares to solve this issue we have.

cheers
Zolf

Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 13, 2011, 06:49:16 pm

somebody please help to solve this issue.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: jheinrichs79 on February 15, 2011, 06:00:46 am
I'm getting the same issue. Anyone find a work around? Any help from Zentyal?
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 15, 2011, 06:27:10 am

somebody please help,i am loosing faith in Zentyal.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: Escorpiom on February 15, 2011, 07:42:31 am
I can't post a quick solution to the problem, but I can give some tips to prevent it.
My root was full a few days ago. It was mainly because of Squid, but logfiles also can cause the problem. My server did not start anymore.

If you are going to install Zentyall, DO NOT use the automated harddisk setup. You'll end up with a very small root (in my case 7GB) that fills up in no-time and the home gets all the space you'll likely never use.
One day your server will freeze, and at reboot it just won't start.
Zentyal is using lvm2 (Logical Volume Manager 2) for the automated hd setup.
If you see /dev/mapper/ it means that your setup uses the LVM2 scheme.

In that case what you can do is resize the root volume, that's where all the important stuff is.
Zentyal LVM2 setup only uses 3 volumes:
- root = all the important stuff
- swap = only used as a kind of swap memory, not for storage
- home = for user files and samba stuff
The /boot volume is NOT part of the LVM2 scheme, you can see it like /dev/sda1.
Don't be confused about hda and sda, it just IDE harddisk or SATA / SCSI harddisk.

Leave swap alone.
Check how much space is used for /home. You have to take some space from /home  and give it to /root.
You'll have to shrink /home, after that expand /root to use that free space.

Now the bad news:
1. You will have to learn the LVM2 partitioning scheme. Search on the web.
2. Resizing is done from the Ubuntu live CD WITHOUT mounting the volumes.
3. Each resize operation has two steps, resizing the volume AND the file system. If you do it wrong, you will LOOSE your /home volume and will have to recreate it (I screwed it).
4. Do NOT use Gparted. It doesn't support LVM2 yet.
5. Do not use the graphical interface "system-config-lvm" as it will wipe out the whole VG.

In some cases you might just start over all again and choose manual hd setup.
I find it a mayor flaw that Zentyal/Ubuntu automatic setup uses such a smal root.  

Some commands you can use from commandline:
df lists the filesystems and used/available space. Start here to see what is full.
pvdisplay lists the physical volume, you can see this as a partition
vgdisplay lists details about the volume group like name, allocated/available space. A volume group can hold one or more partitions, they can sit on different hd's.
lvdisplay lists the logical volumes inside the volume group. On a default install, /root, /swap and /home will be listed.

What can you do to avoid filling your /root?
1. Relocate the Squid cache. I had the cache set to 6GB while my /root was 7GB. Stupid but I learned.
2. Logfiles are being renamed first, then compressed. You might try and delete the gzipped log files, but Zentyal itself has an option to purge logs. Anyway, it has been recommended to rotate logs more aggressively.  

Should we better not use LVM2 partitioning scheme but the normal one instead?
No. I do think that LVM2, once mastered, will be way more easier to manage volumes. It has a learning curve but in the long run it makes adding hd's a snap. Imagine just adding a new harddisk to your system and extending your root volume to use that space?
 
I'm surprised that there is so little input from Zentyal staff on these kind of problems. Sometimes we need just a little guidance, it's hard enough already coming from Windows.

Cheers.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: zolf on February 15, 2011, 03:53:51 pm

thanks a lot for your feedbacks. i am new to linux and i think i might find it difficult to setup LVM.....lets see what i can do.

Title: Re: Xsession: warning: unable to write to /tmp
Post by: peso7 on February 16, 2011, 10:59:29 pm
1st of all: Thanks to Escorpiom - nice work and good support

2nd: Hey, Zentyal stuff, where are you? If Escorpiom is right (and I exactly experience the same problem) this is a timebomb. So, please help to overcome the problem - setting up the server is not a handsome solution.

peso7

@Escorpiom: where are those squid files. I only found a couple of small log files in /var/log/squid.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: peso7 on February 16, 2011, 11:16:39 pm
I just created the ticket #2708
You get there by: http://trac.zentyal.org/ticket/2708
Let's see what happens.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: Escorpiom on February 17, 2011, 03:21:56 am
First off,
Partitioning and other harddisk stuff is basic Ubuntu stuff and has little to do with Zentyal itself.
I think that's why Zentyall staff doesn't support these kind of issues.
Although I understand their motivation, it does create a huge gap for people that are new to Linux and decide to try Zentyal as a first step.
Zentyal will only be accessible to the more experienced Linux folks who already know their basics.

So if we want to bridge that gap we will have to do it ourself. There is not much of a community here (judging by the amount of unanswered posts) so we have to build one  :)

I do believe Zentyal to be a great product, and if the next update takes care of the speed issues I could become a happy user.
In the meanwhile, I'll try to help as much as possible at my n00b level.

From what I have gathered, the root fills up because:
- excessive log files
- Squid cache (located at /var/spool/squid)
- Zentyal backups
 
Note that the default cache size is set at 128MB, so Squid cache will only become a problem if you change it manually to something rather big.
For the log files, you can delete the Gzipped logs safely.

As for the resizing, I only dug in to the LVM method a few days ago. At this point I simply haven't got enough information to write a "step-by-step-resizing-manual".
If you decide to set up Zentyal from scratch, in that case I would recommend:
- Choose LVM. It's much more easier in the long rung
- Depending on your harddisk size, choose a large /root. I would do 30GB - 40GB
- Be carefull with the size of your Squid cache. If you choose several gigabytes they WILL be populated in days so take note of of your /root size.
- Do not worry about /home, if you should need more space it's easy to add or relocate.
- For swap, choose two times your mem size. For example, you have 4GB of RAM, swap can be 8GB.
- /boot is rather small and doesn't change from what I've noticed. It's about 195MB with 32MB used on my system. 
 
Other more experienced users may opt to put /var on their own volume. Above is only meant as a n00b guide.
If you have something to add or if something is wrong, please comment. Others will be thankful.

Cheers.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: Sam Graf on February 17, 2011, 02:39:24 pm
First off,
Partitioning and other harddisk stuff is basic Ubuntu stuff and has little to do with Zentyal itself.
I think that's why Zentyall staff doesn't support these kind of issues.
Although I understand their motivation, it does create a huge gap for people that are new to Linux and decide to try Zentyal as a first step.
Zentyal will only be accessible to the more experienced Linux folks who already know their basics.

This is true of anything Zentyal makes attractive or easier. Because Zentyal includes so many packages, people could come here looking for answers to everything from Ubuntu installation questions (as is the case here) to questions about any given service Zentyal integrates. The breadth of knowledge required to properly support all that looks to me to be considerable.

So Zentyal users can either acquire the habit of looking for help at the home of the packages Zentyal includes (not always productive, regrettably), or, since Zentyal is an open source project, a consistently active community can form and offer help.

But it seems like the majority of people here are drawn by what Zentyal makes possible for Linux noobs rather than by any preexisting Linux expertise (including me). That creates pressure on the Zentyal staff, and it creates frustration here, sadly.

Which is just to say that I agree 100% with
So if we want to bridge that gap we will have to do it ourself. There is not much of a community here (judging by the amount of unanswered posts) so we have to build one  :)

A tall order for a bunch of even the best-intentioned noobs to pull off, but that's the way it is. IMHO, of course. :)
Title: Re: Xsession: warning: unable to write to /tmp
Post by: organetic on March 01, 2011, 08:31:31 pm
I do believe that I've managed to find a solution (at least temporary) for this nasty problem that affects all production servers out there.

I have a home volume group of around 442GB, so what I've made was to take out 30GB of /home and gave it to /root

I've made the following procedures:

1 - Boot the Zentyal Server with the official installation CD
2 - select the option the option to repair the computer with the instaled Zentyal
3 - after selecting the network card and time zone, DO NOT mount a volume
4 - Select the option to execute a console
5 - type the following commands,

first, check your server name and size of the home volume group typing the following command:

# lvdisplay

then, after checking names and sizes

# e2fsck /dev/your-server-name/home
# resize2fs -f /dev/your-server-name/home 412G
# lvreduce -L412G /dev/your-server-name/home
# lvextend -L30G /dev/your-server-name/root
# e2fsck /dev/your-server-name/root
# resize2fs /dev/your-server-name/root

please notice that I've used 412G but you can use another size to define your home partition.
Just don't forget that the space you'll earn for root is the diference between what you had and what you choose here.

Maybe someone can make a script with these commands, asking the user what size to give to root.
and auto-detecting the name of the computer. This would be the preferrable way.

As for my part, at least, the server is now working ok after all.

Please take this as a first approach to the problem, and develop it more.

The Zentyal team could make a script like this run at the end of the installation, so this problem would never happen again.

I'm just worried that the root size keeps expanding... Will this bug eat the whole 30GB ?!!

Title: Re: Xsession: warning: unable to write to /tmp
Post by: Sam Graf on March 01, 2011, 10:01:34 pm
I just took a second test server out of production after months of operation from 9.1GB Fujitsu drives. I'm still inclined to think the problem is in using the Ubuntu automated partition feature. At least nothing in my experience so far indicates that Zentyal has a bug that causes it to eat up all the available space in /. Maybe I have just been able to dodge the bullet?
Title: Re: Xsession: warning: unable to write to /tmp
Post by: Escorpiom on March 03, 2011, 11:48:32 am
Excelent post by organetic. That's the kind of howto we can go by. Thanks!

Sam is right. It is not a Zentyal bug. It is just the automatic partitioning future from Ubuntu.
What Zentyal staff can do perhaps is put up a warning to choose partition sizes carefully.
Anyway I've learned from this and with every new setup I will be skipping the auto-partitioning.

BTW Sam, those 9GB drives seem rather small to me, you might not have had all the modules installed/running. Or had the squid cache set very small? Purge logs frequently?
I'd be more happy with some 40GB partition, using 10GB for the Squid cache.

Cheers.
Title: Re: Xsession: warning: unable to write to /tmp
Post by: Sam Graf on March 03, 2011, 02:11:01 pm
Quite right. These test machines (old Dell PowerEdge 2500s) were providing primarily infrastructure and gateway services with Samba running to provide some select file sharing and Samba testing. The Squid cache was left at the default primarily to limit RAM use. Log rotations were the default weekly (when the logs were enabled, which wasn't always the case given problems talked about elsewhere). It was not a full-blown Zentyal installation by any means.

I've got a similarly set up test server running with 18 GB drives, and the system is using 2111 Mb (not including the default-sized Squid cache). I'm not advocating the use of small drives or anything, but I am saying that running the majority of Zentyal's services (anything I could real-world test) on small drives has not been a problem to me, so far. :)

EDIT: I should probably add, for context, that it's been this way since I first deployed eBox 1.0 in a production environment using a Dell OptiPlex GX110 -- tiny drives, limited RAM. It's a terrible thing to do to a piece of software under testing, for sure. But it's been an awesome learning experience!
Title: Re: Xsession: warning: unable to write to /tmp
Post by: arun on March 14, 2011, 01:13:55 pm
Dear Escorpiom and Organetic,

Thanks for your post. My two server have crashed in such a manner, I was surprised and almost decided to leave Zentyal, but your post has helped me to restore the things in place.

thanks again.
Hope Zentyal and Ubuntu would be listening.

Arun
Title: Re: Xsession: warning: unable to write to /tmp
Post by: stuartiannaylor on May 02, 2011, 12:45:06 am
I have had the same. Total server crash and exactly same problems. Its a proper PAI to not be able to use something simple like gparted on a livecd.
I hate command line scripts for something as critical as partition playing.
Anyway thanks for the posts as here goes.

What I don't understand, is exactly what is filling the root partition? If someone could say then I could clean the aged files?

Stuart
Title: Re: Xsession: warning: unable to write to /tmp
Post by: aerithilynn on May 09, 2011, 03:08:27 am
I have had the same. Total server crash and exactly same problems. Its a proper PAI to not be able to use something simple like gparted on a livecd.
I hate command line scripts for something as critical as partition playing.
Anyway thanks for the posts as here goes.

What I don't understand, is exactly what is filling the root partition? If someone could say then I could clean the aged files?

Stuart



as for me, i am also new to Linux , moreover Zentyal / ubuntu

for root drive, my server having backup function of every week.
for the moment, i keep clearing the path /var/lib/ebox/.cache/duplicity

you will need to use sudo rm -r * to do this.

however occasionally , the space may cloud from somewhere. now i am still studying this ...
Title: Re: Xsession: warning: unable to write to /tmp
Post by: aryana.haribawa on July 07, 2011, 06:29:33 am
Hi, have you solved this problem? If Not, I have written a doc on how to resize Zentyal Root LVM Partition safely. This problem is very common.

Andre
Title: Re: Xsession: warning: unable to write to /tmp
Post by: aryana.haribawa on July 07, 2011, 06:47:45 am
Hi, have you solved this problem? If Not, I have written a doc on how to resize Zentyal Root LVM Partition safely. This problem is very common.

Andre
Title: Re: Xsession: warning: unable to write to /tmp
Post by: stuartiannaylor on July 08, 2011, 05:09:15 pm
I resized the partitions and all worked perfect.

I must admit I was a little nervous. The server was in limbo and I would of prefered to do a backup before the resize.

If you install Zentyal please read the above and change the default partitioning that "Ubuntu" provides. This is an "Ubuntu" problem and not Zentyal but I am sure that they could tweak this at one stage.

Install Zentyal and resize the LVMs before you go to production. You will be sorry otherwise.
ps. Thanks for that doc
Title: Re: Xsession: warning: unable to write to /tmp
Post by: jfeher on February 04, 2012, 09:35:27 am
I faced the same problem this morning.
sudo apt-get clean and a restart solved it.
Hope it helps others.