By Aidan Lewis

SHARARA OIL FIELD, Libya, July 20 (Reuters) - When the head of Libya's state energy company visited Sharara oil field in early July, community leaders and workers crowded into a conference room to ask about jobs, training and services for local people.

When, they asked, would their villages start to see the benefit of the country's rising oil production

"You've been very patient," Mustafa Sanalla reassured them, before adding: "You need to be patient a little longer."

Libya's National Oil Corporation (NOC) raised output to more than one million barrels per day (bpd) at the end of June for the first time since 2013, a feat that seemed near impossible after the chaos that followed the toppling of Muammar Gaddafi in 2011.

The NOC did it by cajoling community leaders, shaming blockaders and navigating a bewildering range of tribal feuds as it reopened fields and patched up infrastructure.

But the comeback, crucial to Libya's survival, is fragile.

To keep it going, NOC chief Sanalla has to tour the country regularly, placating restive armed factions and local groups while at the same time tussling with the U.N.-backed government in Tripoli over budget and control over the oil sector.

Even if the NOC can continue to stop the port and field blockades that crippled Libya's production in recent years, its goal of pushing production to 1.25 million bpd later this year will be difficult to achieve.

Output is already wavering due to problems linked to long shutdowns and a lack of maintenance and investment.

Idled pipelines have corroded, thieves have stolen copper wiring at desert oil facilities. No new drilling has been done for three years and few foreign contractors have returned. Funds to replace and maintain infrastructure are badly needed.

"Unless we have the money, not only can we not increase production, we cannot sustain production," Sanalla told Reuters as he flew back from the visit to Sharara and another southwestern field called El Feel. "Until now we haven't received one penny."

Among the parties closely watching the situation is OPEC, which wants to bolster global oil prices. OPEC exempted members Libya and Nigeria from a deal to cut output that took effect in January, but the group is now considering if and when quickly rising production should be capped.

Sanalla will share his production plans at a meeting of OPEC and non-OPEC oil producers in Russia on Saturday.



CONFLICT, SHUTDOWNS

Libya has the biggest proven oil reserves in Africa. Before the uprising that killed Gaddafi, it was pumping around 1.6 million bpd, much of it light, sweet crude shipped to Europe.

From 2013, however, shutdowns and fighting linked to a messy conflict that spread across the country brought the sector to its knees.

Militia leaders closed ports and pipelines, militants set storage tanks ablaze. Some oil facilities were plundered. Blockades were set up by armed groups demanding salary payments or seeking to cut off a source of government revenues.

A government set up in the east of the country tried, and failed, to sell its own oil through a parallel national oil company in Benghazi.

The NOC in Tripoli survived the conflicts relatively unscathed, emerging as perhaps the only major institution that could function effectively across the country.

Appointed NOC chairman in May 2014, Sanalla and his colleagues travel freely to meet people, unlike the country's politicians who are largely split between east and west and rarely venture beyond their base.

Last summer, with production languishing below 250,000 bpd, Sanalla began a campaign against the blockades, criss-crossing Libya's huge land mass in an eight-seat propeller plane.

"Since last July, for one year, I'm always moving - all the oil fields, all the tribes, all the blockaders. I sit down with all of them and explain the problem," said Sanalla, 56, a chemical engineer and former operations manager who has worked at the NOC for more than three decades. "To solve the problems you need face-to-face dialogue."

A big breakthrough came in September when Ibrahim Jathran, an armed group leader who had closed several key ports and whom Sanalla vocally denounced, lost control of the terminals to eastern-based military commander Khalifa Haftar.

Haftar, widely seen to harbour national ambitions, quickly allowed the NOC to reopen the ports and connected fields.

Three months later a two-year blockade on pipelines leading to Sharara and El Feel was lifted near the western town of Zintan, after months of NOC mediation with the factions involved. The fields now account for about of third of Libya's total output.

During Sanalla's visit to El Feel and Sharara, he warmly greeted employees, leaders of the local community and turbaned guards, pausing for selfies and handshakes before leading discussions over local conditions and requests for aid.

At Sharara, Sanalla handed over provisions for the nearby town of Ubari, including hundreds of beds and equipment for schools. A community leader at El Feel said he needed water pumps, petrol stations, football pitches and leisure parks.

Sanalla would not give details about exactly what he has had to promise in his various deals to reopen fields and pipelines. But he insists he has never offered payments.

"The issue is to explain to people today in two oil fields that we have a partnership with the stakeholders," Sanalla said. He said his message is "production is very crucial to you as well, not just to us".



RISKS

There are limits and risks to the NOC's strategy.

The Government of National Accord in Tripoli has failed to extend its authority or win over factions in the east since it started governing in March last year, meaning bigger political and security threats to Libya's production still loom.

Relations between the GNA and NOC have also soured over a contract dispute with German oil firm Wintershall, which has two concessions in the east. The NOC accused the government of using the dispute to extend its power over the oil sector and accused Wintershall of colluding with the GNA.

Sanalla says politicians need to stop competing for control of oil resources and give the NOC the budget it needs.

The GNA responds that even with oil output on the rise, funding is limited. According to the central bank, oil revenues are expected to reach 16.6 billion Libyan dinars ($11.4 billion) this year, still well short of the 21 billion dinars ($14.5 billion) needed for state salary payments alone.

Workers and locals remain restless, worn down by years sliding living standards. Even oil employees have trouble accessing salaries.

Sharara, where output is about 270,000 bpd, suffered brief closures when valves were switched off in March and April, and again when staff went on strike after a worker drowned in a swimming pool at the field in June.

El Feel, now pumping about 60,000 bpd, did not open until May because of a protest by guards, who in reality are militiamen with local loyalties.

Sanalla says the NOC is doing what it can for communities near oil facilities, but it takes time.

"We cannot substitute (for) a government," Sanalla said in an interview with Reuters in May. "We cannot do everything."

(Editing by Sonya Hepinstall) ((Aidan.Lewis@thomsonreuters.com ; +216-29850352;))